﻿//操作与相关作业活动
var $OperationsAndActivities = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/OperationsAndActivities/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $OperationsAndActivities.List.length; i++) {
                    temp.push($OperationsAndActivities.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $OperationsAndActivities.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/OperationsAndActivities/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($OperationsAndActivities.List.length == 0) {
                        $OperationsAndActivities.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    //var id = p.model.id;
                    //20190520参照Userlist重新修改（仅用于记录）
                    //var JobSteps = getDicValue("21", p.model.JobSteps);
                    //var Task = getDicValue("24", p.model.Task);
                    //var RiskLevel = getDicValue("03", p.model.RiskLevel);
                    var JobSteps = p.model.JobSteps;
                    var Task = p.model.Task;
                    var CheckStandard = p.model.CheckStandard;
                    var RiskOfViolation = p.model.RiskOfViolation;
                    var RiskLevel = p.model.RiskLevel;
                    var TreeNode = p.model.TreeNode;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $OperationsAndActivities.List.length; i++) {
                        var user = $OperationsAndActivities.List[i];
                        //if (id && user.id.indexOf(id) == -1)
                        //    continue;
                        if (JobSteps && user.JobSteps.indexOf(JobSteps) == -1)
                            continue;
                        if (Task && user.Task.indexOf(Task) == -1)
                            continue;
                        if (CheckStandard && user.CheckStandard.indexOf(CheckStandard) == -1)
                            continue;
                        if (RiskOfViolation && user.RiskOfViolation.indexOf(RiskOfViolation) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (TreeNode && user.TreeNode.indexOf(TreeNode) == -1)
                            continue;
                        //20190520参照Userlist重新修改
                        //user.JobSteps = getDicValue("21", user.JobSteps) == '' ? user.JobSteps : getDicValue("21", user.JobSteps);
                        //user.Task = getDicValue("24", user.Task) == '' ? user.Task : getDicValue("24", user.Task);
                        //user.RiskLevel = getDicValue("03", user.RiskLevel) == '' ? user.RiskLevel : getDicValue("03", user.RiskLevel);
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/OperationsAndActivities/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$OperationsAndActivities.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                //20190520参照Userlist重新修改（仅用于记录）
                //myuser.Procedure = getDicKey("21", myuser.Procedure);
                //myuser.WorkTask = getDicKey("24", myuser.WorkTask);
                //myuser.RiskLevel = getDicKey("03", myuser.RiskLevel);
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/OperationsAndActivities/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$OperationsAndActivities.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].JobSteps = thisuser.JobSteps;
                        thisUsers[i].Task = thisuser.Task;
                        thisUsers[i].CheckStandard = thisuser.CheckStandard;
                        thisUsers[i].RiskOfViolation = thisuser.RiskOfViolation;
                        thisUsers[i].RiskLevel = thisuser.RiskLevel;
                        thisUsers[i].TreeNode = thisuser.TreeNode;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$OperationsAndActivities.List.unshift({
                        id: Mock.Random.id(),
                        JobSteps: thisuser.JobSteps,
                        Task: thisuser.Task,
                        CheckStandard: thisuser.CheckStandard,
                        RiskOfViolation: thisuser.RiskOfViolation,
                        RiskLevel: thisuser.RiskLevel,
                        TreeNode: randomTreeNode(myTree)
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $OperationsAndActivities.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                JobSteps: randomKey("21"),//作业步骤
                Task: randomKey("24"),//工作任务
                CheckStandard: randomValue("wdl01a"),//检查标准
                RiskOfViolation: randomValue("wdl01b"),//违反标准的风险
                RiskLevel: randomKey('03'),//风险等级
                TreeNode: randomTreeNode(myTree)
            }));

        }
    }
}
//维修作业活动
var $RepairActivities = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/RepairActivities/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $RepairActivities.List.length; i++) {
                    temp.push($RepairActivities.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $RepairActivities.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/RepairActivities/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($RepairActivities.List.length == 0) {
                        $RepairActivities.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    //var id = p.model.id;
                    var JobModule = p.model.JobModule;
                    var RepairItems = p.model.RepairItems;
                    var CheckStandard = p.model.CheckStandard;
                    var RiskOfViolation = p.model.RiskOfViolation;
                    var RiskLevel = p.model.RiskLevel;
                    var JobActivities = p.model.JobActivities;
                    var TreeNode = p.model.TreeNode;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $RepairActivities.List.length; i++) {
                        var user = $RepairActivities.List[i];
                        //if (id && user.id.indexOf(id) == -1)
                        //    continue;
                        if (JobModule && user.JobModule.indexOf(JobModule) == -1)
                            continue;
                        if (RepairItems && user.RepairItems.indexOf(RepairItems) == -1)
                            continue;
                        if (CheckStandard && user.CheckStandard.indexOf(CheckStandard) == -1)
                            continue;
                        if (RiskOfViolation && user.RiskOfViolation.indexOf(RiskOfViolation) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (JobActivities && user.JobActivities.indexOf(JobActivities) == -1)
                            continue;
                        if (TreeNode && user.TreeNode.indexOf(TreeNode) == -1)
                            continue;
                        //user.JobModule = getDicValue("36", user.JobModule) == '' ? user.JobModule : getDicValue("36", user.JobModule);
                        //user.RepairItems = getDicValue("37", user.RepairItems) == '' ? user.RepairItems : getDicValue("37", user.RepairItems);
                        //user.JobActivities = getDicValue("38", user.JobActivities) == '' ? user.JobActivities : getDicValue("38", user.JobActivities);
                        //user.RiskLevel = getDicValue("03", user.RiskLevel) == '' ? user.RiskLevel : getDicValue("03", user.RiskLevel);
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/RepairActivities/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$RepairActivities.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                //myuser.JobModule = getDicKey("36", myuser.JobModule);
                //myuser.RepairItems = getDicKey("37", myuser.RepairItems);
                //myuser.JobActivities = getDicKey("38", myuser.JobActivities);
                //myuser.RiskLevel = getDicKey("03", myuser.RiskLevel);
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/RepairActivities/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$RepairActivities.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].JobModule = thisuser.JobModule;
                        thisUsers[i].RepairItems = thisuser.RepairItems;
                        thisUsers[i].CheckStandard = thisuser.CheckStandard;
                        thisUsers[i].RiskOfViolation = thisuser.RiskOfViolation;
                        thisUsers[i].RiskLevel = thisuser.RiskLevel;
                        thisUsers[i].JobActivities = thisuser.JobActivities;
                        thisUsers[i].TreeNode = thisuser.TreeNode;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$RepairActivities.List.unshift({
                        id: Mock.Random.id(),
                        JobModule: thisuser.JobModule,
                        RepairItems: thisuser.RepairItems,
                        JobActivities: thisuser.JobActivities,
                        RiskOfViolation: thisuser.RiskOfViolation,
                        RiskLevel: thisuser.RiskLevel,
                        CheckStandard: thisuser.CheckStandard,
                        TreeNode: randomTreeNode(myTree)
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $RepairActivities.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                JobModule: randomKey("36"),//作业模块
                RepairItems: randomKey("37"),//维修项目
                JobActivities: randomKey("38"),//工作活动
                RiskLevel: randomKey('03'),//风险等级
                CheckStandard: randomValue("wdl02a"),//检查标准
                RiskOfViolation: randomValue("wdl02b"),//违反标准的风险
                TreeNode: randomTreeNode(myTree)
            }));

        }
    }
}
//设备设施
var $EquipmentFacilities = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/EquipmentFacilities/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $EquipmentFacilities.List.length; i++) {
                    temp.push($EquipmentFacilities.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $EquipmentFacilities.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/EquipmentFacilities/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($EquipmentFacilities.List.length == 0) {
                        $EquipmentFacilities.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    //var id = p.model.id;



                    var Equipment = p.model.Equipment;
                    var FunctionalPart = p.model.FunctionalPart;
                    var SubfunctionalPart = p.model.SubfunctionalPart;
                    var Parts = p.model.Parts;
                    var ExpectedFunction = p.model.ExpectedFunction;
                    var Fault = p.model.Fault;
                    var RiskLevel = p.model.RiskLevel;
                    var CheckStandard = p.model.CheckStandard;
                    var RiskOfViolation = p.model.RiskOfViolation;
                    var TreeNode = p.model.TreeNode;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $EquipmentFacilities.List.length; i++) {
                        var user = $EquipmentFacilities.List[i];
                        //if (id && user.id.indexOf(id) == -1)
                        //    continue;
                        if (Equipment && user.Equipment.indexOf(Equipment) == -1)
                            continue;
                        if (FunctionalPart && user.FunctionalPart.indexOf(FunctionalPart) == -1)
                            continue;
                        if (SubfunctionalPart && user.SubfunctionalPart.indexOf(SubfunctionalPart) == -1)
                            continue;
                        if (Parts && user.Parts.indexOf(Parts) == -1)
                            continue;
                        if (ExpectedFunction && user.ExpectedFunction.indexOf(ExpectedFunction) == -1)
                            continue;
                        if (Fault && user.Fault.indexOf(Fault) == -1)
                            continue;
                        if (CheckStandard && user.CheckStandard.indexOf(CheckStandard) == -1)
                            continue;
                        if (RiskOfViolation && user.RiskOfViolation.indexOf(RiskOfViolation) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (TreeNode && user.TreeNode.indexOf(TreeNode) == -1)
                            continue;
                        //user.Equipment = getDicValue("39", user.Equipment) == '' ? user.Equipment : getDicValue("39", user.Equipment);
                        //user.FunctionalPart = getDicValue("40", user.FunctionalPart) == '' ? user.FunctionalPart : getDicValue("40", user.FunctionalPart);
                        //user.SubfunctionalPart = getDicValue("41", user.SubfunctionalPart) == '' ? user.SubfunctionalPart : getDicValue("41", user.SubfunctionalPart);
                        //user.Parts = getDicValue("42", user.Parts) == '' ? user.Parts : getDicValue("42", user.Parts);
                        //user.ExpectedFunction = getDicValue("43", user.ExpectedFunction) == '' ? user.ExpectedFunction : getDicValue("43", user.ExpectedFunction);
                        //user.Fault = getDicValue("44", user.Fault) == '' ? user.Fault : getDicValue("44", user.Fault);
                        //user.RiskLevel = getDicValue("03", user.RiskLevel) == '' ? user.RiskLevel : getDicValue("03", user.RiskLevel);
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/EquipmentFacilities/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$EquipmentFacilities.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                //myuser.Equipment = getDicKey("39", myuser.Equipment);
                //myuser.FunctionalPart = getDicKey("40", myuser.FunctionalPart);
                //myuser.SubfunctionalPart = getDicKey("41", myuser.SubfunctionalPart);
                //myuser.Parts = getDicKey("42", myuser.Parts);
                //myuser.ExpectedFunction = getDicKey("43", myuser.ExpectedFunction);
                //myuser.Fault = getDicKey("44", myuser.Fault);
                //myuser.RiskLevel = getDicKey("03", myuser.RiskLevel);
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/EquipmentFacilities/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$EquipmentFacilities.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Equipment = thisuser.Equipment;
                        thisUsers[i].FunctionalPart = thisuser.FunctionalPart;
                        thisUsers[i].CheckStandard = thisuser.CheckStandard;
                        thisUsers[i].RiskOfViolation = thisuser.RiskOfViolation;
                        thisUsers[i].RiskLevel = thisuser.RiskLevel;
                        thisUsers[i].SubfunctionalPart = thisuser.SubfunctionalPart;
                        thisUsers[i].Parts = thisuser.Parts;
                        thisUsers[i].ExpectedFunction = thisuser.ExpectedFunction;
                        thisUsers[i].Fault = thisuser.Fault;
                        thisUsers[i].TreeNode = thisuser.TreeNode;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$EquipmentFacilities.List.unshift({
                        id: Mock.Random.id(),
                        Equipment: thisuser.Equipment,
                        FunctionalPart: thisuser.FunctionalPart,
                        SubfunctionalPart: thisuser.SubfunctionalPart,
                        Parts: thisuser.Parts,
                        ExpectedFunction: thisuser.ExpectedFunction,
                        Fault: thisuser.Fault,
                        RiskOfViolation: thisuser.RiskOfViolation,
                        RiskLevel: thisuser.RiskLevel,
                        CheckStandard: thisuser.CheckStandard,
                        TreeNode: randomTreeNode(myTree)
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $EquipmentFacilities.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                Equipment: randomKey("39"),//设备
                FunctionalPart: randomKey("40"),//功能部分
                SubfunctionalPart: randomKey("41"),//子功能部分
                Parts: randomKey("42"),//部件
                ExpectedFunction: randomKey("43"),//预期功能
                Fault: randomKey("44"),//故障
                RiskLevel: randomKey('03'),//风险等级
                CheckStandard: randomValue("wdl03a"),//检查标准
                RiskOfViolation: randomValue("wdl03b"),//违反标准的风险
                TreeNode: randomTreeNode(myTree)
            }));

        }
    }
}
//工艺介质
var $ProcessMedium = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/ProcessMedium/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $ProcessMedium.List.length; i++) {
                    temp.push($ProcessMedium.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $ProcessMedium.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/ProcessMedium/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($ProcessMedium.List.length == 0) {
                        $ProcessMedium.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    //var id = p.model.id;
                    var Factor = p.model.Factor;
                    var Introducer = p.model.Introducer;
                    var Deviation = p.model.Deviation;
                    var CheckStandard = p.model.CheckStandard;
                    var RiskOfViolation = p.model.RiskOfViolation;
                    var RiskLevel = p.model.RiskLevel;
                    var TreeNode = p.model.TreeNode;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $ProcessMedium.List.length; i++) {
                        var user = $ProcessMedium.List[i];
                        //if (id && user.id.indexOf(id) == -1)
                        //    continue;
                        if (Factor && user.Factor.indexOf(Factor) == -1)
                            continue;
                        if (Introducer && user.Introducer.indexOf(Introducer) == -1)
                            continue;
                        if (CheckStandard && user.CheckStandard.indexOf(CheckStandard) == -1)
                            continue;
                        if (RiskOfViolation && user.RiskOfViolation.indexOf(RiskOfViolation) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (Deviation && user.Deviation.indexOf(Deviation) == -1)
                            continue;
                        if (TreeNode && user.TreeNode.indexOf(TreeNode) == -1)
                            continue;
                        //user.Factor = getDicValue("31", user.Factor) == '' ? user.Factor : getDicValue("31", user.Factor);
                        //user.Introducer = getDicValue("32", user.Introducer) == '' ? user.Introducer : getDicValue("32", user.Introducer);
                        //user.Deviation = getDicValue("33", user.Deviation) == '' ? user.Deviation : getDicValue("33", user.Deviation);
                        //user.RiskLevel = getDicValue("03", user.RiskLevel) == '' ? user.RiskLevel : getDicValue("03", user.RiskLevel);
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/ProcessMedium/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$ProcessMedium.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                //myuser.Factor = getDicKey("31", myuser.Factor);
                //myuser.Introducer = getDicKey("32", myuser.Introducer);
                //myuser.Deviation = getDicKey("33", myuser.Deviation);
                //myuser.RiskLevel = getDicKey("03", myuser.RiskLevel);
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/ProcessMedium/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$ProcessMedium.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Factor = thisuser.Factor;
                        thisUsers[i].Introducer = thisuser.Introducer;
                        thisUsers[i].CheckStandard = thisuser.CheckStandard;
                        thisUsers[i].RiskOfViolation = thisuser.RiskOfViolation;
                        thisUsers[i].RiskLevel = thisuser.RiskLevel;
                        thisUsers[i].Deviation = thisuser.Deviation;
                        thisUsers[i].TreeNode = thisuser.TreeNode;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$ProcessMedium.List.unshift({
                        id: Mock.Random.id(),
                        Factor: thisuser.Factor,
                        Introducer: thisuser.Introducer,
                        Deviation: thisuser.Deviation,
                        RiskOfViolation: thisuser.RiskOfViolation,
                        RiskLevel: thisuser.RiskLevel,
                        CheckStandard: thisuser.CheckStandard,
                        TreeNode: randomTreeNode(myTree)
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $ProcessMedium.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                Factor: randomKey("31"),//作业模块
                Introducer: randomKey("32"),//维修项目
                Deviation: randomKey("33"),//工作活动
                RiskLevel: randomKey('03'),//风险等级
                CheckStandard: randomValue("wdl04a"),//检查标准
                RiskOfViolation: randomValue("wdl04b"),//违反标准的风险
                TreeNode: randomTreeNode(myTree)
            }));

        }
    }
}
//场所环境
var $PlaceEnvironment = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/PlaceEnvironment/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $PlaceEnvironment.List.length; i++) {
                    temp.push($PlaceEnvironment.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $PlaceEnvironment.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/PlaceEnvironment/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($PlaceEnvironment.List.length == 0) {
                        $PlaceEnvironment.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    //var id = p.model.id;
                    var PlaceEnvironment = p.model.PlaceEnvironment;
                    var EnergySource = p.model.EnergySource;
                    var CheckStandard = p.model.CheckStandard;
                    var RiskOfViolation = p.model.RiskOfViolation;
                    var RiskLevel = p.model.RiskLevel;
                    var TreeNode = p.model.TreeNode;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $PlaceEnvironment.List.length; i++) {
                        var user = $PlaceEnvironment.List[i];
                        //if (id && user.id.indexOf(id) == -1)
                        //    continue;
                        if (PlaceEnvironment && user.PlaceEnvironment.indexOf(PlaceEnvironment) == -1)
                            continue;
                        if (EnergySource && user.EnergySource.indexOf(EnergySource) == -1)
                            continue;
                        if (CheckStandard && user.CheckStandard.indexOf(CheckStandard) == -1)
                            continue;
                        if (RiskOfViolation && user.RiskOfViolation.indexOf(RiskOfViolation) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (TreeNode && user.TreeNode.indexOf(TreeNode) == -1)
                            continue;
                        //user.PlaceEnvironment = getDicValue("34", user.PlaceEnvironment) == '' ? user.PlaceEnvironment : getDicValue("34", user.PlaceEnvironment);
                        //user.EnergySource = getDicValue("35", user.EnergySource) == '' ? user.EnergySource : getDicValue("35", user.EnergySource);
                        //user.RiskLevel = getDicValue("03", user.RiskLevel) == '' ? user.RiskLevel : getDicValue("03", user.RiskLevel);
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/PlaceEnvironment/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$PlaceEnvironment.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                //myuser.PlaceEnvironment = getDicKey("34", myuser.PlaceEnvironment);
                //myuser.EnergySource = getDicKey("35", myuser.EnergySource);
                //myuser.RiskLevel = getDicKey("03", myuser.RiskLevel);
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/PlaceEnvironment/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$PlaceEnvironment.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].PlaceEnvironment = thisuser.PlaceEnvironment;
                        thisUsers[i].EnergySource = thisuser.EnergySource;
                        thisUsers[i].CheckStandard = thisuser.CheckStandard;
                        thisUsers[i].RiskOfViolation = thisuser.RiskOfViolation;
                        thisUsers[i].RiskLevel = thisuser.RiskLevel;
                        thisUsers[i].TreeNode = thisuser.TreeNode;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$PlaceEnvironment.List.unshift({
                        id: Mock.Random.id(),
                        PlaceEnvironment: thisuser.PlaceEnvironment,
                        EnergySource: thisuser.EnergySource,
                        RiskOfViolation: thisuser.RiskOfViolation,
                        RiskLevel: thisuser.RiskLevel,
                        CheckStandard: thisuser.CheckStandard,
                        TreeNode: randomTreeNode(myTree)
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $PlaceEnvironment.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                PlaceEnvironment: randomKey("34"),//场所环境
                EnergySource: randomKey("35"),//能量源
                RiskLevel: randomKey('03'),//风险等级
                CheckStandard: randomValue("wdl05a"),//检查标准
                RiskOfViolation: randomValue("wdl05b"),//违反标准的风险
                TreeNode: randomTreeNode(myTree)
            }));

        }
    }
}
//基础管理类隐患排查库
var $BasicInvestigateDatabase = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/BasicInvestigateDatabase/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $BasicInvestigateDatabase.List.length; i++) {
                    temp.push($BasicInvestigateDatabase.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $BasicInvestigateDatabase.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/BasicInvestigateDatabase/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($BasicInvestigateDatabase.List.length == 0) {
                        $BasicInvestigateDatabase.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    //var id = p.model.id;
                    var Name = p.model.Name;
                    var Operator = p.model.Operator;
                    var AddTime = p.model.AddTime;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $BasicInvestigateDatabase.List.length; i++) {
                        var user = $BasicInvestigateDatabase.List[i];
                        if (Name && user.Name.indexOf(Name) == -1)
                            continue;
                        if (Operator && user.Operator.indexOf(Operator) == -1)
                            continue;
                        if (AddTime && user.AddTime.indexOf(AddTime) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/BasicInvestigateDatabase/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$BasicInvestigateDatabase.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/BasicInvestigateDatabase/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$BasicInvestigateDatabase.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Name = thisuser.Name;
                        thisUsers[i].Operator = thisuser.Operator;
                        thisUsers[i].AddTime = thisuser.AddTime;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$BasicInvestigateDatabase.List.unshift({
                        id: Mock.Random.id(),
                        Name: thisuser.Name,
                        Operator: Mock.Random.cname(),
                        AddTime: Mock.Random.date()
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            //var treeid = randomTreeNode(RisksTree);
            ////根据生成的treeid获取对应的name
            //var treename = getTreeById(treeid, RisksTree).name;
            $BasicInvestigateDatabase.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                Name: getTreeValue(RisksTree, randomTreeNode(RisksTree, '0', true)),//隐患排查库
                Operator: Mock.Random.cname(),//添加人
                AddTime: Mock.Random.date(),//添加时间

            }));

        }
    }
}
//排查项目
var $InvestigationItems = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/InvestigationItems/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $InvestigationItems.List.length; i++) {
                    temp.push($InvestigationItems.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $InvestigationItems.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/InvestigationItems/GetList': Mock.mock(host + url, type,
                function (options) {
                    if ($InvestigationItems.List.length == 0) {
                        $InvestigationItems.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    //var id = p.model.id;
                    var Database = p.model.Database;
                    var InvestigationItems = p.model.InvestigationItems;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $InvestigationItems.List.length; i++) {
                        var user = $InvestigationItems.List[i];

                        //if (id && user.id.indexOf(id) == -1)
                        //    continue;
                        if (Database && user.Database.indexOf(Database) == -1)
                            continue;
                        if (InvestigationItems && user.InvestigationItems.indexOf(InvestigationItems) == -1)
                            continue;
                        //user.Database = getDicValue("300", user.Database) == '' ? user.Database : getDicValue("300", user.Database);
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/InvestigationItems/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$InvestigationItems.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/InvestigationItems/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$InvestigationItems.List;

                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Database = thisuser.Database + '';
                        thisUsers[i].InvestigationItems = thisuser.InvestigationItems;
                        thisUsers[i].Operator = thisuser.Operator;
                        thisUsers[i].AddTime = thisuser.AddTime;

                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$InvestigationItems.List.unshift({
                        id: Mock.Random.id(),
                        Database: thisuser.Database + '',
                        InvestigationItems: thisuser.InvestigationItems,
                        InspectionContentInspectionStandard: '企业应当依法设置安全生产管理机构，配备专职安全生产管理',
                        Operator: Mock.Random.cname(),
                        AddTime: Mock.Random.date(),
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $InvestigationItems.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                Database: randomValue("n100"),//级别,//隐患排查库
                InvestigationItems: randomValue("pcxm"),//排查项目
                InspectionContentInspectionStandard: randomValue("pcbz"),
                Operator: Mock.Random.cname(),//添加人
                AddTime: Mock.Random.date(),//添加时间
            }));

        }
    }
}
//排查内容和排查标准管理
var $ContentsAndStandards = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/ContentsAndStandards/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $ContentsAndStandards.List.length; i++) {
                    temp.push($ContentsAndStandards.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $ContentsAndStandards.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/ContentsAndStandards/GetList': Mock.mock(host + url, type,
                function (options) {

                    var delIDs = options.body;
                    if ($ContentsAndStandards.List.length == 0) {
                        $ContentsAndStandards.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var InvestigationContents = p.model.InvestigationContents;
                    var InvestigationItems = p.model.InvestigationItems;
                    var Tree = p.model.Tree;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $ContentsAndStandards.List.length; i++) {
                        var user = $ContentsAndStandards.List[i];
                        if (InvestigationContents && user.InvestigationContents.indexOf(InvestigationContents) == -1)
                            continue;
                        if (InvestigationItems && user.InvestigationItems.indexOf(InvestigationItems) == -1)
                            continue;
                        if (Tree && user.Tree.indexOf(Tree) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/ContentsAndStandards/get': Mock.mock(host + url + '?' + param, type, function (options) {
                var myUsers = parent.$ContentsAndStandards.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/ContentsAndStandards/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$ContentsAndStandards.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].InvestigationItems = thisuser.InvestigationItems;
                        thisUsers[i].InvestigationContents = thisuser.InvestigationContents;
                        thisUsers[i].Operator = thisuser.Operator;
                        thisUsers[i].AddTime = thisuser.AddTime;
                        thisUsers[i].Database = thisuser.Database;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$ContentsAndStandards.List.unshift({
                        id: Mock.Random.id(),
                        InvestigationItems: thisuser.InvestigationItems,
                        InvestigationContents: thisuser.InvestigationContents,
                        Operator: Mock.Random.cname(),
                        AddTime: Mock.Random.date(),
                        Database: thisuser.Database
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var dataBaseId = randomTreeNode(BasicTree, '0', true);
            var Tree = randomTreeNode(BasicTree, dataBaseId);
            $ContentsAndStandards.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                Tree: Tree,//排查项目
                InvestigationItems: randomValue("pcxm"),//排查项目
                InvestigationContents: randomValue("pcbz"),//排查内容和排查标准
                Operator: Mock.Random.cname(),//添加人
                AddTime: Mock.Random.date(),//添加时间
                Database: dataBaseId//基础排查标准知识库
            }));

        }
    }
}
//隐患等级管理
var $RiskLevel = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/RiskLevel/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $RiskLevel.List.length; i++) {
                    temp.push($RiskLevel.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $RiskLevel.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/RiskLevel/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($RiskLevel.List.length == 0) {
                        $RiskLevel.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    //var id = p.model.id;
                    var Level = p.model.Level;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $RiskLevel.List.length; i++) {
                        var user = $RiskLevel.List[i];
                        if (Level && user.Level.indexOf(Level) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/RiskLevel/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$RiskLevel.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/RiskLevel/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$RiskLevel.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Level = thisuser.Level;
                        thisUsers[i].Remark = thisuser.Remark;
                        thisUsers[i].ConcernScope = thisuser.ConcernScope;
                        thisUsers[i].OverdueScope = thisuser.OverdueScope;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$RiskLevel.List.unshift({
                        id: Mock.Random.id(),
                        Level: thisuser.Level,
                        Remark: thisuser.Remark,
                        ConcernScope: thisuser.ConcernScope,
                        OverdueScope: thisuser.OverdueScope,
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargePidB = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
            var PersonInChargeIdB = randomTreeNode(PersonInChargeTree, PersonInChargePidB);
            var level = randomValue("03");
            $RiskLevel.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                Level: level,//级别
                Remark: level,//备注
                ConcernScope: [PersonInChargeIdA],//关注人员范围
                OverdueScope: [PersonInChargeIdB],//超期人员范围
                num: 3,
            }));

        }
    }
}
//隐患类型管理 
var $RiskType = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            //获取Input数据
            case '/api/RiskType/get': Mock.mock(host + url + '?' + param, type, function (options) {
                var myUsers = parent.RiskType;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }

                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
        }
    }
}
//隐患类别管理
var $RiskCategory = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/RiskCategory/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $RiskCategory.List.length; i++) {
                    temp.push($RiskCategory.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $RiskCategory.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/RiskCategory/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($RiskCategory.List.length == 0) {
                        $RiskCategory.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    //var id = p.model.id;
                    var Category = p.model.Category;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $RiskCategory.List.length; i++) {
                        var user = $RiskCategory.List[i];
                        if (Category && user.Category.indexOf(Category) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/RiskCategory/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$RiskCategory.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/RiskCategory/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$RiskCategory.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Category = thisuser.Category;
                        thisUsers[i].Remark = thisuser.Remark;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$RiskCategory.List.unshift({
                        id: Mock.Random.id(),
                        Category: thisuser.Category,
                        Remark: thisuser.Remark
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $RiskCategory.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                Category: Mock.mock('@cparagraph(1, 3)'),//类别
                Remark: Mock.mock('@cparagraph(1, 3)'),//备注
            }));

        }
    }
}
//隐患排查内容管理
var $RiskContent = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {

            //隐患排查情况查询_20190626
            case '/api/RiskContent/GetRiskData': Mock.mock(host + url, type,
                function (options) {
                    if ($RiskContent.List.length == 0) {
                        $RiskContent.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var Unit = p.model.Unit;
                    var Objective = p.model.Objective;
                    var PersonInCharge = p.model.PersonInCharge;
                    var Participant = p.model.Participant;
                    var Content = p.model.Content;

                    //排查时间
                    var CheckTime = [];
                    CheckTime = p.model.CheckTime;

                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $RiskContent.List.length; i++) {
                        var user = $RiskContent.List[i];

                        if (Unit && user.Unit.indexOf(Unit) == -1)
                            continue;
                        if (Objective && user.Objective.indexOf(Objective) == -1)
                            continue;
                        if (PersonInCharge && user.PersonInCharge.indexOf(PersonInCharge) == -1)
                            continue;
                        if (Participant && user.Participant.indexOf(Participant) == -1)
                            continue;
                        if (Content && user.Content.indexOf(Content) == -1)
                            continue;
                        //user.Database = getDicValue("300", user.Database) == '' ? user.Database : getDicValue("300", user.Database);
                        if (CheckTime != null) {
                            //排查时间开始
                            if (CheckTime[0] && CheckTime[0] >= user.aTime)
                                continue;

                            //排查时间结束
                            if (CheckTime[1] && CheckTime[1] <= user.aTime)
                                continue;
                        }


                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;


            //删除
            case '/api/RiskContent/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $RiskContent.List.length; i++) {
                    temp.push($RiskContent.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $RiskContent.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/RiskContent/GetList': Mock.mock(host + url, type,
                function (options) {
                    if ($RiskContent.List.length == 0) {
                        $RiskContent.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var Unit = p.model.Unit;
                    var Objective = p.model.Objective;
                    var PersonInCharge = p.model.PersonInCharge;
                    var Participant = p.model.Participant;
                    var Content = p.model.Content;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $RiskContent.List.length; i++) {
                        var user = $RiskContent.List[i];

                        if (Unit && user.Unit.indexOf(Unit) == -1)
                            continue;
                        if (Objective && user.Objective.indexOf(Objective) == -1)
                            continue;
                        if (PersonInCharge && user.PersonInCharge.indexOf(PersonInCharge) == -1)
                            continue;
                        if (Participant && user.Participant.indexOf(Participant) == -1)
                            continue;
                        if (Content && user.Content.indexOf(Content) == -1)
                            continue;
                        //user.Database = getDicValue("300", user.Database) == '' ? user.Database : getDicValue("300", user.Database);
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            //获取Input数据
            case '/api/RiskContent/get': Mock.mock(host + url + '?' + param, type, function (options) {
                var myUsers = parent.$RiskContent.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            //提交
            case '/api/RiskContent/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$RiskContent.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Unit = thisuser.Unit;
                        thisUsers[i].Objective = thisuser.Objective;
                        thisUsers[i].PersonInCharge = thisuser.PersonInCharge;
                        thisUsers[i].Participant = thisuser.Participant;
                        thisUsers[i].Content = thisuser.Content;
                        thisUsers[i].Requirements = thisuser.Requirements;
                        thisUsers[i].StandardType = thisuser.StandardType;
                        thisUsers[i].InvestigationPost = thisuser.InvestigationPost;
                        thisUsers[i].Remark = thisuser.Remark;
                        thisUsers[i].InputTable = thisuser.InputTable;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$RiskContent.List.unshift({
                        id: Mock.Random.id(),
                        Unit: thisuser.Unit,
                        Objective: thisuser.Objective,
                        PersonInCharge: thisuser.PersonInCharge,
                        Participant: thisuser.Participant,
                        Content: thisuser.Content,
                        Requirements: thisuser.Requirements,
                        Frequency: thisuser.Frequency,
                        StandardType: thisuser.StandardType,
                        InvestigationPost: thisuser.InvestigationPost,
                        Remark: thisuser.Remark,
                        InputTable: thisuser.InputTable,
                        // FrequencyText: thisuser.Frequency?$RiskContent.ShowFrequencyText(thisuser.Frequency.Type, thisuser.Frequency.MoveUp, thisuser.Frequency.Text):''
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取设置频次数据
            case '/api/RiskContent/getfrequency': Mock.mock(host + url + '?' + param, type, function (options) {
                var myUsers = parent.parent.$RiskContent.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            //提交设置频次
            case '/api/RiskContent/SaveSetFrequency': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.parent.$RiskContent.List;
                //console.log(1)
                //console.log(options)
                //console.log(1)
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Frequency = thisuser.Frequency;
                        thisUsers[i].FrequencyText = $RiskContent.ShowFrequencyText(thisuser.Frequency.Type, thisuser.Frequency.MoveUp, thisuser.Frequency.Text)
                        break;
                    }
                }
                //parent.myuser.FrequencyText = "123123";
                return { result: "Success", message: null, data: null };
            }); break;
            //删除input内table
            case '/api/RiskContent/DeleteInputTable': Mock.mock(host + url, type, function (options) {
                var delIDs = JSON.parse(options.body);//要删除的id数组

                if (delIDs.length > 1) {
                    var tempdelIDs = [];
                    for (var i = 0; i < delIDs.length; i++) {
                        if (tempdelIDs.indexOf(delIDs[i]) == -1) {
                            tempdelIDs.push(delIDs[i]);
                        }
                    }
                    delIDs = tempdelIDs;
                }

                var list = parent.$RiskContent.List;//原数据
                var temp = [];//临时数据组
                for (var i = 0; i < list.length; i++) {
                    temp.push(list[i]);
                }
                //声明被删除对象的索引及数量数组{index:,count:}
                var delTeam = [];
                var index = -1;//删除索引默认值
                var count = 0;//删除数量默认值
                var listIndex = -1;
                //遍历传过来的需要被删除的id集合
                for (var k = 0; k < delIDs.length; k++) {
                    //遍历临时数据组
                    for (var i = 0; i < temp.length; i++) {
                        //遍历临时数据组中的InputTable对象中的数据
                        for (var j = 0; j < temp[i].InputTable.length; j++) {
                            if (delIDs[k] === temp[i].InputTable[j].id) {
                                listIndex = i;
                                if (count === 0) {
                                    index = j;
                                    count++;
                                }
                                else {
                                    if (temp[i].InputTable[j].id === temp[i].InputTable[j - 1].id) count++;
                                }
                            }
                        }
                    }
                    if (index > -1) {
                        delTeam.push({ 'index': index, 'count': count, 'listIndex': listIndex });
                        count = 0;
                        index = -1;
                    }
                }
                for (var i = delTeam.length - 1; i >= 0; i--) {
                    parent.$RiskContent.List[delTeam[i].listIndex].InputTable.splice(delTeam[i].index, delTeam[i].count);
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取Input数据
            case '/api/RiskContent/getInputTable': Mock.mock(host + url + '?' + param, type, function (options) {
                var myUsers = parent.parent.$RiskContent.List;
                myuser = [];
                for (var i = 0; i < myUsers.length; i++) {

                    for (var j = 0; j < myUsers[i].InputTable.length; j++) {
                        if (myUsers[i].InputTable[j].id == vueApp.id) {
                            myuser.push(myUsers[i].InputTable[j]);
                        }
                    }

                }
                var _myuser = {};
                if (myuser.length > 0) {
                    myuser.forEach(function (v, i) {
                        if (i == 0) {
                            for (var key in v) {
                                _myuser[key] = v[key];
                            }
                            _myuser.Standard = [];
                            _myuser.Standard.push(v.Standard);
                        }
                        else {
                            _myuser.Standard.push(v.Standard);
                        }
                    })
                }
                return {
                    result: "Success", message: null, data: _myuser
                };
            }); break;
            //提交Input数据
            case '/api/RiskContent/SaveInputTable': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.parent.$RiskContent.List;
                if (thisuser.id) {
                    var InputTableIndex = [];
                    for (var i = 0; i < thisUsers.length; i++) {
                        if (thisUsers[i].id == my.pid) {
                            for (var j = 0; j < thisUsers[i].InputTable.length; j++) {
                                if (thisUsers[i].InputTable[j].id == thisuser.id) {
                                    InputTableIndex.push(j);
                                }
                            }
                            for (var k = InputTableIndex.length - 1; k >= 0; k--) {
                                thisUsers[i].InputTable.splice(InputTableIndex[k], 1);
                            }
                            for (var l = thisuser.Standard.length - 1; l >= 0; l--) {
                                var data = {
                                    id: thisuser.id,
                                    Project: thisuser.Project,//排查项目
                                    Region: thisuser.Region,//涉及区域
                                    Remark: thisuser.Remark,//备注说明
                                    Standard: thisuser.Standard[l],//排查标准
                                    RiskLevel: thisuser.RiskLevel
                                }
                                thisUsers[i].InputTable.splice(InputTableIndex[0], 0, data);
                            }
                            break;
                        }

                    }
                }
                else {
                    for (var i = 0; i < thisUsers.length; i++) {
                        if (thisUsers[i].id == my.pid) {
                            var id = Mock.Random.id();
                            for (var j = thisuser.Standard.length - 1; j >= 0; j--) {
                                thisUsers[i].InputTable.unshift({
                                    id: id,
                                    Project: thisuser.Project,//排查项目
                                    Region: thisuser.Region,//涉及区域
                                    Remark: thisuser.Remark,//备注说明
                                    Standard: thisuser.Standard[j],//排查标准
                                    RiskLevel: randomKey("03")//隐患级别
                                })
                            }

                        }
                    }
                }

                return { result: "Success", message: null, data: null };
            }); break;
            //提交手动录入隐患排查标准方式
            case '/api/RiskContent/SaveInputStandard': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.parent.parent.$RiskContent.List;


                console.log('thisuser', thisuser)
                if (thisuser.id) {
                    for (var i = 0; i < thisUsers.length; i++) {
                        if (thisUsers[i].id == thisuser.pid) {
                            for (var j = 0; j < thisUsers[i].InputTable.length; j++) {
                                if (thisUsers[i].InputTable[j].id == thisuser.id) {
                                    thisUsers[i].InputTable.splice(j, 0, {
                                        id: thisuser.id,
                                        Project: thisUsers[i].InputTable[j].Project,//排查项目
                                        Region: thisUsers[i].InputTable[j].Region,//涉及区域
                                        Remark: thisUsers[i].InputTable[j].Remark,//备注说明
                                        Standard: {
                                            name: Mock.Random.id(),
                                            data: thisuser.InputStandard,
                                            type: ''//暂无对应设置，先空缺
                                        },//排查标准
                                        RiskLevel: randomKey("03")//隐患级别
                                    });
                                    break;
                                }
                            }
                        }
                    }
                }
                else {
                    $RiskContent.tempTypeInput = thisuser;
                }


                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    tempTypeInput: null,//存储添加排查标准情况下，没有主id的“录入排查标准”的临时介质
    InitArray: function () {

        for (var i = 0; i < 80; i++) {
            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargePidB = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
            var PersonInChargeIdB = randomTreeNode(PersonInChargeTree, PersonInChargePidB);

            var Frequency_MoveUp = Math.floor(Math.random() * 10 + 1);
            var Frequency_Type = Cycle[Math.floor(Math.random() * Cycle.length)];
            var Frequency_Text = '2020-05-23 17:00:00';

            //Input页内的table数据
            var StandardList = $RiskContent.generateData();//生成排查标准数据
            var InputTable = [];
            for (var k = 0; k < 5; k++) {
                var id = Mock.Random.id()
                var Project = Mock.mock('@csentence(4)');
                var Region = randomTreeNode(myTree, '0', true);
                var Remark = Mock.mock('@csentence(6)');
                var c = 0;
                for (var j = 0; j < Math.random() * 8 + 1; j++) {
                    //随机生成排查标准内容
                    var Standard = StandardList[Math.floor(Math.random() * StandardList.length)];
                    //去重开关
                    var flag = true;
                    InputTable.forEach(function (v, i) {
                        //判断是否已有相同内容的排查标准
                        if (v.Standard.name === Standard.name) {
                            flag = false;
                        }
                    })
                    if (flag) {
                        c++;
                        //加个序号而已
                        Standard.data = c + '.' + Standard.data;
                        InputTable.push(Mock.mock({
                            id: id,
                            AddClass: randomValue('n104'),//排查项目
                            Project: Project,//排查项目
                            Region: Region,//涉及区域
                            Remark: Remark,//备注说明
                            //Standard: `${j + 1}.` + Mock.mock('@csentence(6)'),//排查标准
                            Standard: Standard,//排查标准
                            RiskLevel: randomValue("03"),//隐患级别
                            num: i
                        }));
                    }

                }

            }
            $RiskContent.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                // Unit: Mock.mock('@cparagraph(1, 3)'),//排查单位
                Unit: randomValue('85'),//排查单位
                Objective: randomValue("wdl02a"),//排查目的
                PersonInCharge: PersonInChargeIdA,//负责人
                Participant: [PersonInChargeIdB],//参与人员
                Content: randomValue("wdl02a"),//排查内容
                Requirements: randomValue("wdl02a"),//排查要求
                Frequency: {
                    IsNot: true,//是否提醒
                    Month: randomKey("61"),//月
                    Week: randomKey("63"),//周
                    Day: randomKey("62"),//日
                    Hour: randomKey("64"),//时
                    Text: Frequency_Text,//自定义内容
                    Type: Frequency_Type,//radio选中类型
                    MoveUp: Frequency_MoveUp + '',//天数
                },//提醒频次
                StandardType: randomValue("59"),//排查标准类型
                InvestigationPost: randomValue("60"),//排查岗位
                DailyAndPlan: randomValue("n103"),//日常排查/计划排查
                Remark: '备注',//备注
                Standard: randomValue('pcxm'),//检查标准
                RiskLevel: randomValue('03'),//风险等级
                FrequencyText: $RiskContent.ShowFrequencyText(Frequency_Type, Frequency_MoveUp, Frequency_Text),//提醒频次结果文本
                InputTable: InputTable,

                //隐患排查情况查询
                aProject: randomValue('pcxm'),  //排查项目
                aRegion: getTreeValue(myTree, randomTreeNode(myTree, '0', true)), //排查区域
                aPerson: randomValue('09'), //上报人
                aTime: Mock.Random.date(),  //上报时间

            }));

        }
    },
    //生成FrequencyText
    ShowFrequencyText: function (Frequency_Type, Frequency_MoveUp, Frequency_Text) {
        switch (Frequency_Type) {
            case "Year": return "每年执行1次，年底提前" + Frequency_MoveUp + '天提醒'; break;
            case "Month": return "每月执行1次，月底提前" + Frequency_MoveUp + '天提醒'; break;
            case "HalfYear": return "每半年执行1次，提前" + Frequency_MoveUp + '天提醒'; break;
            case "Quarter": return "每季度执行1次，提前" + Frequency_MoveUp + '天提醒'; break;
            case "TenDay": return "每旬执行1次，提前" + Frequency_MoveUp + '天提醒'; break;
            case "Week": return "每周执行1次，提前" + Frequency_MoveUp + '天提醒'; break;
            case "Customized": return "在" + Frequency_Text + "执行1次，提前" + Frequency_MoveUp + '天提醒'; break;
            case "Day": return "每天执行1次，提前" + Frequency_MoveUp + '小时提醒'; break;
            default: break;
        }
    },
    generateData: function () {
        const data = [];
        for (let i = 1; i <= 15; i++) {
            data.push(Mock.mock({
                name: i,
                data: '排查标准' + i,
                type: '6'
            }));
        }
        return data;
    }
}


//隐患排查治理管理-隐患验收
var $RiskAcceptance = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/RiskAcceptance/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $RiskAcceptance.List.length; i++) {
                    temp.push($RiskAcceptance.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $RiskAcceptance.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/RiskAcceptance/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($RiskAcceptance.List.length == 0) {
                        $RiskAcceptance.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var Discoverer = p.model.Discoverer;
                    var DiscoveryTime = p.model.DiscoveryTime;
                    var RectificationLeading = p.model.RectificationLeading;
                    var Rectificationer = p.model.Rectificationer;
                    var RiskLevel = p.model.RiskLevel;
                    console.log(p)
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $RiskAcceptance.List.length; i++) {
                        var user = $RiskAcceptance.List[i];
                        if (Discoverer && user.Discoverer.indexOf(Discoverer) == -1)
                            continue;
                        if (RectificationLeading && user.RectificationLeading.indexOf(RectificationLeading + '') == -1)
                            continue;
                        if (DiscoveryTime && user.DiscoveryTime.indexOf(DiscoveryTime) == -1)
                            continue;
                        if (Rectificationer && user.Rectificationer.indexOf(Rectificationer + '') == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/RiskAcceptance/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$RiskAcceptance.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/RiskAcceptance/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$RiskAcceptance.List;

                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].ApprovalOpinion = thisuser.ApprovalOpinion;
                        break;
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargePidB = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
            var PersonInChargeIdB = randomTreeNode(PersonInChargeTree, PersonInChargePidB);
            var dataNum = [];//获取隐患治理编号后几位时间
            var myDate = new Date();    //获取当前年份(2位)
            var year = myDate.getFullYear();    //获取完整的年份(4位,1970-????)
            var month = myDate.getMonth();       //获取当前月份(0-11,0代表1月)
            if (month < 10) {
                month = "0" + (month * 1 + 1);
            };
            var day = myDate.getDate();        //获取当前日(1-31)
            if (day < 10) {
                day = "0" + day;
            };
            var dayNow = year + (month) + day;
            dataNum.push(dayNow);
            $RiskAcceptance.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                troubleNum: 'XXXX' + dataNum,//隐患治理编号

                Discoverer: Mock.Random.cname(),
                DiscoveryTime: Mock.Random.datetime(),
                RiskLevel: randomKey('03'),//风险等级
                RectificationLeading: [PersonInChargeIdA],
                Rectificationer: [PersonInChargeIdB],
                PlanTime: Mock.Random.date(),
                ActualTime: Mock.Random.date(),
                //表单内容
                RiskDescription: randomValue("w1012004"),
                RectificationCase: randomValue("w1012001"),
                RectificationFund: '200万',
                Department: '技术科',
                HaveContingencyPlan: '是',
                CurrentPlan: randomValue("w1012002"),
                RectificationDescription: randomValue("w1012005"),
                RectificationImg: [Mock.Random.image('200x100', '#67C23A', '#FFFFFF', 'Test Image1'), Mock.Random.image('200x100', '#E6A23C', '#FFFFFF', 'Test Image2')],
                ApprovalOpinion: '',
                status: randomValue("n105"),
                ReportTime: Mock.Random.datetime('yyyy-MM-dd HH:mm:ss'), //上报时间
                ReportDepartment: randomValue("111"), //上报部门
                ReportPersonnel: Mock.Random.cname(),//上报人员
                DevelopPlanTime: Mock.Random.datetime('yyyy-MM-dd HH:mm:ss'), //制定整改计划时间
                Department: '技术科', //整改责任部门
                RectificationLeading: Mock.Random.cname(),//整改责任人
                PlanTime: Mock.Random.datetime('yyyy-MM-dd'), //计划完成时间
                ActualTime: Mock.Random.datetime('yyyy-MM-dd HH:mm:ss'), //实际完成时间

            }));

        }
    }
}

//操作与相关作业活动
var $RiskReport = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/RiskReport/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $RiskReport.List.length; i++) {
                    temp.push($RiskReport.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $RiskReport.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/RiskReport/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($RiskReport.List.length == 0) {
                        $RiskReport.InitArray();
                    }
                    if ($RiskReport.PlanReportList.length == 0) {
                        $RiskReport.InitPlanReport();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var Discoverer = p.model.Discoverer;
                    var DiscoveryTime = p.model.DiscoveryTime;
                    var RiskType = p.model.RiskType;
                    var ReportType = p.model.ReportType;
                    var RiskLevel = p.model.RiskLevel;
                    var ScreeningStandard = p.model.ScreeningStandard;
                    var TreeNode = p.model.TreeNode;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $RiskReport.List.length; i++) {
                        var user = $RiskReport.List[i];
                        if (Discoverer && user.Discoverer.indexOf(Discoverer) == -1)
                            continue;
                        if (DiscoveryTime && user.DiscoveryTime.indexOf(DiscoveryTime) == -1)
                            continue;
                        if (RiskType && user.RiskType.indexOf(RiskType) == -1)
                            continue;
                        if (ReportType && (user.ReportType + '').indexOf(ReportType) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (ScreeningStandard && user.ScreeningStandard.indexOf(ScreeningStandard) == -1)
                            continue;
                        if (TreeNode && user.TreeNode.indexOf(TreeNode) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            //计划隐患上报-选择排查内容
            case '/api/RiskReport/GetPlanSelectList': Mock.mock(host + url, type,
                function (options) {
                    //if ($RiskReport.PlanReportList.length == 0) {
                    //    $RiskReport.InitPlanReport();
                    //}

                    var List = parent.parent.$RiskReport.PlanReportList
                    var p = JSON.parse(options.body);
                    //条件
                    var Plan = p.model.Plan;
                    var RiskRegion = p.RiskRegion;
                    var RiskPosition = p.RiskPosition;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < List.length; i++) {
                        var user = List[i];
                        if (Plan && user.Plan.indexOf(Plan) == -1)
                            continue;
                        if (RiskRegion && user.RiskRegion.indexOf(RiskRegion) == -1)
                            continue;
                        if (RiskPosition && user.RiskPosition.indexOf(RiskPosition) == -1)
                            continue;
                        limitUsers2.push(user);
                    }
                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/RiskReport/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$RiskReport.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交列表修改或者上报
            case '/api/RiskReport/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$RiskReport.List;

                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Discoverer = thisuser.Discoverer;
                        thisUsers[i].DiscoveryTime = thisuser.DiscoveryTime;
                        thisUsers[i].OrganizationType = thisuser.OrganizationType;
                        thisUsers[i].InspectType = thisuser.InspectType;
                        thisUsers[i].RiskLevel = thisuser.RiskLevel;
                        thisUsers[i].RiskRegion = thisuser.RiskRegion;
                        thisUsers[i].RiskPosition = thisuser.RiskPosition;
                        thisUsers[i].RiskType = thisuser.RiskType;
                        thisUsers[i].RiskDescription = thisuser.RiskDescription;
                        thisUsers[i].BeforeRectificationImg = thisuser.BeforeRectificationImg;
                        thisUsers[i].ReportType = thisuser.ReportType;
                        thisUsers[i].TreeNode = thisuser.TreeNode;

                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //上报的数据提交到临时数组中
                    var temp = parent.parent.$RiskReport.ReportTempList;
                    temp.unshift({
                        id: Mock.Random.id(),
                        Discoverer: thisuser.Discoverer,
                        DiscoveryTime: thisuser.DiscoveryTime,
                        OrganizationType: thisuser.OrganizationType,
                        InspectType: thisuser.InspectType,
                        RiskRegion: thisuser.RiskRegion,
                        RiskPosition: thisuser.RiskPosition,
                        RiskType: thisuser.RiskType,
                        RiskDescription: thisuser.RiskDescription,
                        BeforeRectificationImg: thisuser.BeforeRectificationImg,
                        RiskLevel: thisuser.RiskLevel,
                        ReportType: thisuser.ReportType,
                        TreeNode: randomTreeNode(myTree)

                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //计划隐患上报提交
            case '/api/RiskReport/SavePlanReport': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                console.log(3333333333333)
                console.log('thisuser', thisuser)
                //获取上报提交的临时数组
                var temp = parent.$RiskReport.ReportTempList;
                if (temp) {
                    temp.forEach(function (v, i) {
                        parent.$RiskReport.List.unshift({
                            id: v.id,//*
                            Discoverer: v.Discoverer,//*
                            DiscoveryTime: v.DiscoveryTime,//*
                            OrganizationType: v.OrganizationType,//组织类别
                            InspectType: v.InspectType,//检查类别
                            RiskRegion: v.RiskRegion,//区域*
                            RiskPosition: v.RiskPosition,//位置*
                            RiskType: v.RiskType,//隐患分类
                            RiskDescription: v.RiskDescription,//隐患描述
                            BeforeRectificationImg: v.BeforeRectificationImg,//整改前图片
                            RiskLevel: v.RiskLevel,//隐患等级
                            ReportType: 102001,//计划隐患上报
                        });
                    })
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取Input数据
            case '/api/RiskReport/getInputTable': Mock.mock(host + url + '?' + param, type, function (options) {
                var myUsers = parent.parent.$RiskReport.List;
                myuser = [];
                for (var i = 0; i < myUsers.length; i++) {

                    for (var j = 0; j < myUsers[i].InputTable.length; j++) {
                        if (myUsers[i].InputTable[j].id == vueApp.id) {
                            myuser.push(myUsers[i].InputTable[j]);
                        }
                    }

                }
                var _myuser = {};
                if (myuser.length > 0) {
                    myuser.forEach(function (v, i) {
                        if (i == 0) {
                            for (var key in v) {
                                _myuser[key] = v[key];
                            }
                            _myuser.Standard = [];
                            _myuser.Standard.push(v.Standard);
                        }
                        else {
                            _myuser.Standard.push(v.Standard);
                        }
                    })
                }
                return {
                    result: "Success", message: null, data: _myuser
                };
            }); break;
            //删除input内table
            case '/api/RiskReport/DeleteInputTable': Mock.mock(host + url, type, function (options) {
                var delIDs = JSON.parse(options.body);//要删除的id数组

                if (delIDs.length > 1) {
                    var tempdelIDs = [];
                    for (var i = 0; i < delIDs.length; i++) {
                        if (tempdelIDs.indexOf(delIDs[i]) == -1) {
                            tempdelIDs.push(delIDs[i]);
                        }
                    }
                    delIDs = tempdelIDs;
                }
                console.log('delIDs', delIDs);
                var list = parent.parent.$RiskReport.PlanReportList;
                //var b = parent.$RiskReport.PlanReportList;
                //var c = $RiskReport.PlanReportList;
                //var list = parent.$RiskReport.PlanReportList;//原数据
                //var list = $RiskReport.PlanReportList
                var temp = [];//临时数据组
                for (var i = 0; i < list.length; i++) {
                    temp.push(list[i]);
                }
                //声明被删除对象的索引及数量数组{index:,count:}
                var delTeam = [];
                var index = -1;//删除索引默认值
                var count = 0;//删除数量默认值
                var listIndex = -1;
                //遍历传过来的需要被删除的id集合

                for (var k = 0; k < delIDs.length; k++) {
                    //遍历临时数据组
                    for (var i = 0; i < temp.length; i++) {
                        //遍历临时数据组中的InputTable对象中的数据
                        for (var j = 0; j < temp[i].InputTable.length; j++) {

                            if (delIDs[k] === temp[i].InputTable[j].id) {
                                console.log('A', delIDs[k])
                                console.log('B', temp[i].InputTable[j].id)
                                listIndex = i;
                                if (count === 0) {
                                    index = j;
                                    count++;
                                }
                                else {
                                    if (temp[i].InputTable[j].id === temp[i].InputTable[j - 1].id) count++;
                                }
                            }
                        }
                    }

                    if (index > -1) {
                        delTeam.push({ 'index': index, 'count': count, 'listIndex': listIndex });
                        count = 0;
                        index = -1;
                    }
                }
                for (var i = delTeam.length - 1; i >= 0; i--) {
                    console.log(delTeam[i])
                    parent.$RiskReport.List[delTeam[i].listIndex].InputTable.splice(delTeam[i].index, delTeam[i].count);
                }
                debugger
                return { result: "Success", message: null, data: null };
            }); break;
            //提交手动录入隐患排查标准方式
            case '/api/RiskReport/SaveInputStandard': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.parent.parent.$RiskReport.List;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.pid) {
                        for (var j = 0; j < thisUsers[i].InputTable.length; j++) {
                            if (thisUsers[i].InputTable[j].id == thisuser.id) {
                                thisUsers[i].InputTable.splice(j, 0, {
                                    id: thisuser.id,
                                    Project: thisUsers[i].InputTable[j].Project,//排查项目
                                    Region: thisUsers[i].InputTable[j].Region,//涉及区域
                                    Remark: thisUsers[i].InputTable[j].Remark,//备注说明
                                    Standard: {
                                        name: Mock.Random.id(),
                                        data: thisuser.InputStandard,
                                        type: ''//暂无对应设置，先空缺
                                    },//排查标准
                                    RiskLevel: randomKey("03")//隐患级别
                                });
                                break;
                            }
                        }
                    }
                }

                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    PlanReportList: [],
    //上报按钮临时数组
    ReportTempList: [],
    InitPlanReport: function () {

        for (var i = 0; i < 5; i++) {
            var RiskRegion = randomTreeNode(myTree, '0', true);
            var RiskPosition = randomTreeNode(myTree, RiskRegion);

            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargePidB = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
            var PersonInChargeIdB = randomTreeNode(PersonInChargeTree, PersonInChargePidB);

            //Input页内的table数据
            var StandardList = $RiskContent.generateData();//生成排查标准数据
            var InputTable = [];
            for (var k = 0; k < 5; k++) {
                var id = Mock.Random.id()
                var Project = Mock.mock('@csentence(4)');
                var Region = randomTreeNode(myTree, '0', true);
                var Remark = Mock.mock('@csentence(6)');
                var c = 0;
                for (var j = 0; j < Math.random() * 8 + 1; j++) {
                    //随机生成排查标准内容
                    var Standard = StandardList[Math.floor(Math.random() * StandardList.length)];
                    //去重开关
                    var flag = true;
                    InputTable.forEach(function (v, i) {
                        //判断是否已有相同内容的排查标准
                        if (v.Standard.name === Standard.name) {
                            flag = false;
                        }
                    })
                    if (flag) {
                        c++;
                        //加个序号而已
                        Standard.data = c + '.' + Standard.data;
                        InputTable.push(Mock.mock({
                            id: id,
                            Project: Project,//排查项目
                            Region: Region,//涉及区域
                            Remark: Remark,//备注说明
                            //Standard: `${j + 1}.` + Mock.mock('@csentence(6)'),//排查标准
                            Standard: Standard,//排查标准
                            RiskLevel: randomKey("03"),//隐患级别
                            SelectStatus: '115001',
                        }));
                    }

                }
            }
            $RiskReport.PlanReportList.push(Mock.mock({
                id: Mock.Random.id(),//序号
                RiskRegion: RiskRegion,
                RiskPosition: RiskPosition,
                Plan: Mock.mock('@cparagraph(1, 3)') + '计划',

                Unit: Mock.mock('@cparagraph(1, 3)'),//排查单位
                Objective: Mock.mock('@cparagraph(1, 3)'),//排查目的
                PersonInCharge: PersonInChargeIdA,//负责人
                Participant: [PersonInChargeIdB],//参与人员
                Content: Mock.mock('@cparagraph(1, 3)'),//排查内容
                Requirements: Mock.mock('@cparagraph(1, 3)'),//排查要求
                Requirements: Mock.mock('@cparagraph(1, 3)'),//排查要求


                InputTable: InputTable

            }));
        }
    },
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var RiskRegion = randomTreeNode(myTree, '0', true);
            var RiskPosition = randomTreeNode(myTree, RiskRegion);

            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
            var dataNum = [];//获取隐患治理编号后几位时间
            var myDate = new Date();    //获取当前年份(2位)
            var year = myDate.getFullYear();    //获取完整的年份(4位,1970-????)
            var month = myDate.getMonth();       //获取当前月份(0-11,0代表1月)
            if (month < 10) {
                month = "0" + (month * 1 + 1);
            };
            var day = myDate.getDate();        //获取当前日(1-31)
            if (day < 10) {
                day = "0" + day;
            };
            var dayNow = year + (month) + day;
            dataNum.push(dayNow)
            $RiskReport.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                Discoverer: Mock.Random.cname(),
                OrganizationType: randomKey("103"),//组织类别
                DiscoveryTime: Mock.Random.datetime(),//隐患发现时间
                InspectType: randomKey("101"),//检查类别
                RiskRegion: RiskRegion,//隐患所属区域
                RiskPosition: RiskPosition,//隐患位置
                RiskType: randomKey("100"),//隐患分类
                RiskLevel: randomKey('03'),//风险等级
                ReportType: randomKey('102'),//上报类别
                status: randomValue("82"), //状态
                ScreeningStandard: randomValue("59"), //排查标准
                Project: Mock.mock('@csentence(4)'),
                RiskDescription: randomValue("w1012004"),
                TreeNode: randomTreeNode(myTree),
                BeforeRectificationImg: [
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#67C23A', '#FFFFFF', 'Test Image1'),
                    },
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#E6A23C', '#FFFFFF', 'Test Image2'),
                    },
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#F56C6C', '#FFFFFF', 'Test Image3'),
                    }
                ],
                //把外部机构多的几列整合到此处
                InstitutionTypes: '上级单位',//机构类别
                CompanyName: randomValue("w1012006"),//单位名称
                RiskDescription: randomValue("w1012004"),//隐患描述
                RectificationLeading: PersonInChargeIdA,//整改负责人
                troubleNum: 'XXXX' + dataNum,//隐患治理编号
            }));

        }
    },
    generateData: function () {
        const data = [];
        for (let i = 1; i <= 15; i++) {
            data.push(Mock.mock({
                name: i,
                data: '排查标准' + i,
                type: '6'
            }));
        }
        return data;
    }
}
//非计划隐患上报
var $UnPlanReport = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/UnPlanReport/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $UnPlanReport.List.length; i++) {
                    temp.push($UnPlanReport.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {
                    if (delIDs.includes(temp[i].id)) {
                        $UnPlanReport.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/UnPlanReport/GetList': Mock.mock(host + url, type,
                function (options) {
                    if ($UnPlanReport.List.length == 0) {
                        $UnPlanReport.InitArray();
                    }
                    console.log($UnPlanReport.List)

                    return {
                        result: "Success", message: null,
                        data: $UnPlanReport.List
                    };
                }); break;
            //获取数据
            case '/api/UnPlanReport/getInputTable': Mock.mock(host + url + '?' + param, type, function (options) {
                var myUsers = parent.$UnPlanReport.List;
                myuser = [];
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser.push(myUsers[i]);
                    }
                }
                var _myuser = {};
                if (myuser.length > 0) {
                    myuser.forEach(function (v, i) {
                        if (i == 0) {
                            for (var key in v) {
                                _myuser[key] = v[key];
                            }
                            _myuser.Standard = [];
                            _myuser.Standard.push(v.Standard);
                        }
                        else {
                            _myuser.Standard.push(v.Standard);
                        }
                    })
                }
                return {
                    result: "Success", message: null, data: _myuser
                };
            }); break;
            //提交
            case '/api/UnPlanReport/SaveInputTable': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$UnPlanReport.List;
                if (thisuser.id) {
                    var InputTableIndex = [];
                    //获取当前id所有数据的索引值
                    for (var i = 0; i < thisUsers.length; i++) {
                        if (thisUsers[i].id == thisuser.id) {
                            InputTableIndex.push(i);
                        }
                    }
                    //根据索引数组集合循环删除数据
                    for (var k = InputTableIndex.length - 1; k >= 0; k--) {
                        thisUsers.splice(InputTableIndex[k], 1);
                    }
                    //填充数据
                    for (var l = thisuser.Standard.length - 1; l >= 0; l--) {
                        var data = {
                            id: thisuser.id,
                            Project: thisuser.Project,//排查项目
                            Region: thisuser.Region,//涉及区域
                            Remark: thisuser.Remark,//备注说明
                            Standard: thisuser.Standard[l],//排查标准
                            RiskLevel: thisuser.RiskLevel
                        }
                        thisUsers.splice(InputTableIndex[k], 0, data);
                    }
                }
                else {
                    var id = Mock.Random.id();
                    for (var j = thisuser.Standard.length - 1; j >= 0; j--) {
                        thisUsers.unshift({
                            id: id,
                            Project: thisuser.Project,//排查项目
                            Region: thisuser.Region,//涉及区域
                            Remark: thisuser.Remark,//备注说明
                            Standard: thisuser.Standard[j],//排查标准
                            RiskLevel: randomKey("03")//隐患级别
                        })
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //提交手动录入隐患排查标准方式
            case '/api/UnPlanReport/SaveInputStandard': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.parent.$UnPlanReport.List;
                if (thisuser.id) {
                    for (var i = 0; i < thisUsers.length; i++) {
                        if (thisUsers[i].id == thisuser.id) {
                            thisUsers.splice(i, 0, {
                                id: thisuser.id,
                                Project: thisUsers[i].Project,//排查项目
                                Region: thisUsers[i].Region,//涉及区域
                                Remark: thisUsers[i].Remark,//备注说明
                                Standard: {
                                    name: Mock.Random.id(),
                                    data: thisuser.InputStandard,
                                    type: ''//暂无对应设置，先空缺
                                },//排查标准
                                RiskLevel: randomKey("03")//隐患级别
                            });
                            break;
                        }
                    }
                }
                else {
                    //新增有问题
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            var InputTable = [];
            var id = Mock.Random.id()
            var Project = Mock.mock('@csentence(4)');
            var Region = randomTreeNode(myTree, '0', true);
            var Remark = Mock.mock('@csentence(6)');

            var StandardList = $UnPlanReport.generateData();//生成排查标准数据
            var c = 0;
            for (var j = 0; j < Math.random() * 5 + 1; j++) {
                //随机生成排查标准内容
                var Standard = StandardList[Math.floor(Math.random() * StandardList.length)];
                var flag = true;
                InputTable.forEach(function (v, i) {
                    //判断是否已有相同内容的排查标准
                    if (v.Standard.name === Standard.name) {
                        flag = false;
                    }
                })
                if (flag) {
                    c++;
                    //加个序号而已
                    Standard.data = c + '.' + Standard.data;
                    InputTable.push(Mock.mock({
                        id: id,
                        Project: Project,//排查项目
                        Region: Region,//涉及区域
                        Remark: Remark,//备注说明
                        //Standard: `${j + 1}.` + Mock.mock('@csentence(6)'),//排查标准
                        Standard: Standard,//排查标准
                        RiskLevel: randomKey("03")//隐患级别
                    }));
                }
            }
            InputTable.forEach(function (v, i) {
                $UnPlanReport.List.push(v);
            })

        }
    },
    generateData: function () {
        const data = [];
        for (let i = 1; i <= 5; i++) {
            data.push(Mock.mock({
                name: i,
                data: '排查标准' + i,
                type: '6'
            }));
        }
        return data;
    }
}
//外部检查内容管理
var $ExternalInspection = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {

            //获取List数据_隐患管理台账查询20190628
            case '/api/ExternalInspection/GetRiskSel': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($ExternalInspection.List.length == 0) {
                        $ExternalInspection.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var RegionName = p.model.RegionName;
                    var RiskPosition = p.model.RiskPosition;
                    var OrganizationType = p.model.OrganizationType;
                    var InspectTime = p.model.InspectTime;
                    var InspectType = p.model.InspectType;
                    var RiskType = p.model.RiskType;
                    var RiskLevel = p.model.RiskLevel;
                    var RectificationLeading = p.model.RectificationLeading;

                    var aState = p.model.aState;

                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $ExternalInspection.List.length; i++) {
                        var user = $ExternalInspection.List[i];
                        if (RegionName && user.RegionName.indexOf(RegionName) == -1)
                            continue;
                        if (RiskPosition && user.RiskPosition.indexOf(RiskPosition) == -1)
                            continue;
                        if (OrganizationType && user.OrganizationType.indexOf(OrganizationType) == -1)
                            continue;
                        if (InspectTime && user.InspectTime.indexOf(InspectTime) == -1)
                            continue;
                        if (InspectType && user.InspectType.indexOf(InspectType) == -1)
                            continue;
                        if (RiskType && user.RiskType.indexOf(RiskType) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (RectificationLeading && user.RectificationLeading.indexOf(RectificationLeading) == -1)
                            continue;

                        if (aState && user.aState.indexOf(aState) == -1)
                            continue;

                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;

            ////删除
            case '/api/ExternalInspection/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $ExternalInspection.List.length; i++) {
                    temp.push($ExternalInspection.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $ExternalInspection.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/ExternalInspection/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($ExternalInspection.List.length == 0) {
                        $ExternalInspection.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var RegionName = p.model.RegionName;
                    var RiskPosition = p.model.RiskPosition;
                    var OrganizationType = p.model.OrganizationType;
                    var InspectTime = p.model.InspectTime;
                    var InspectType = p.model.InspectType;
                    var RiskType = p.model.RiskType;
                    var RiskLevel = p.model.RiskLevel;
                    var RectificationLeading = p.model.RectificationLeading;


                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $ExternalInspection.List.length; i++) {
                        var user = $ExternalInspection.List[i];
                        if (RegionName && user.RegionName.indexOf(RegionName) == -1)
                            continue;
                        if (RiskPosition && user.RiskPosition.indexOf(RiskPosition) == -1)
                            continue;
                        if (OrganizationType && user.OrganizationType.indexOf(OrganizationType) == -1)
                            continue;
                        if (InspectTime && user.InspectTime.indexOf(InspectTime) == -1)
                            continue;
                        if (InspectType && user.InspectType.indexOf(InspectType) == -1)
                            continue;
                        if (RiskType && user.RiskType.indexOf(RiskType) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (RectificationLeading && user.RectificationLeading.indexOf(RectificationLeading) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/ExternalInspection/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$ExternalInspection.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/ExternalInspection/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$ExternalInspection.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].InstitutionTypes = thisuser.InstitutionTypes;
                        thisUsers[i].CompanyName = thisuser.CompanyName;
                        thisUsers[i].RiskDescription = thisuser.RiskDescription;
                        thisUsers[i].RegionName = thisuser.RegionName;
                        thisUsers[i].RiskPosition = thisuser.RiskPosition;
                        thisUsers[i].OrganizationType = thisuser.OrganizationType;
                        thisUsers[i].InspectTime = thisuser.InspectTime;
                        thisUsers[i].InspectType = thisuser.InspectType;
                        thisUsers[i].RiskType = thisuser.RiskType;
                        thisUsers[i].RiskLevel = thisuser.RiskLevel;
                        thisUsers[i].RectificationLeading = thisuser.RectificationLeading;
                        thisUsers[i].BeforeRectificationImg = thisuser.BeforeRectificationImg;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$ExternalInspection.List.unshift({
                        id: Mock.Random.id(),
                        InstitutionTypes: thisuser.InstitutionTypes,
                        CompanyName: thisuser.CompanyName,
                        RiskDescription: thisuser.RiskDescription,
                        RegionName: thisuser.RegionName,
                        RiskPosition: thisuser.RiskPosition,
                        OrganizationType: thisuser.OrganizationType,
                        InspectTime: thisuser.InspectTime,
                        InspectType: thisuser.InspectType,
                        RiskType: thisuser.RiskType,
                        RiskLevel: thisuser.RiskLevel,
                        RectificationLeading: thisuser.RectificationLeading,
                        BeforeRectificationImg: thisuser.BeforeRectificationImg,
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);

            var RiskRegion = randomTreeNode(myTree, '0', true);
            var RiskPosition = randomTreeNode(myTree, RiskRegion);
            var dataNum = [];//获取隐患治理编号后几位时间
            var myDate = new Date();    //获取当前年份(2位)
            var year = myDate.getFullYear();    //获取完整的年份(4位,1970-????)
            var month = myDate.getMonth();       //获取当前月份(0-11,0代表1月)
            if (month < 10) {
                month = "0" + (month * 1 + 1);
            };
            var day = myDate.getDate();        //获取当前日(1-31)
            if (day < 10) {
                day = "0" + day;
            };
            var dayNow = year + (month) + day;
            dataNum.push(dayNow)
            $ExternalInspection.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                troubleNum: 'XXXX' + dataNum,//隐患治理编号

                InstitutionTypes: '上级单位',
                CompanyName: randomValue("w1012006"),//
                RiskDescription: randomValue("w1012004"),
                RegionName: RiskRegion,
                RiskPosition: RiskPosition,
                OrganizationType: randomKey("103"),
                InspectTime: Mock.Random.datetime(),
                InspectType: randomKey('101'),
                RiskType: randomKey('100'),
                RiskLevel: randomKey("03"),
                RectificationLeading: PersonInChargeIdA,
                Discoverer: Mock.Random.cname(),
                BeforeRectificationImg: [
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#67C23A', '#FFFFFF', 'Test Image1'),
                    },
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#E6A23C', '#FFFFFF', 'Test Image2'),
                    },
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#F56C6C', '#FFFFFF', 'Test Image3'),
                    }
                ],

                //隐患管理台账查询20190628
                RectificationCase: randomValue("w1012001"), //整改目标或方案
                RectificationFund: '200万', //整改资金
                Department: '技术科', //整改责任部门
                PlanTime: Mock.Random.datetime('yyyy-MM-dd'), //计划完成时间
                CurrentPlan: randomValue("w1012002"), //当前控制措施
                HaveContingencyPlan: '否', //是否制定应急预案
                ActualTime: Mock.Random.datetime('yyyy-MM-dd'), //实际完成时间
                RectificationDescription: randomValue("w1012005"), //整改描述
                BeforeRImg: Mock.Random.image('100x50', '#67C23A', '#FFFFFF', 'Test Image1'), //整改前照片
                AfterRImg: Mock.Random.image('100x50', '#E6A23C', '#FFFFFF', 'Test Image2'), //整改后照片
                AppointPerson: Mock.Random.cname(),//验收人
                AppointTime: Mock.Random.datetime('yyyy-MM-dd'),  //验收时间
                ApprovalResult: randomValue("w1012003"), //验收意见
                //aState: randomValue("82"), //状态
                aState: randomKey("82"), //状态
                CheckTime: Mock.Random.datetime('yyyy-MM-dd'), //检查时间


            }));

        }
    }
}

//申请修改审批
var $ApplyModifyApproval = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {

            //获取List数据_隐患管理台账查询20190628
            case '/api/ApplyModifyApproval/GetRiskSel': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($ApplyModifyApproval.List.length == 0) {
                        $ApplyModifyApproval.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var RegionName = p.model.RegionName;
                    var RiskPosition = p.model.RiskPosition;
                    var OrganizationType = p.model.OrganizationType;
                    var InspectTime = p.model.InspectTime;
                    var InspectType = p.model.InspectType;
                    var RiskType = p.model.RiskType;
                    var RiskLevel = p.model.RiskLevel;
                    var RectificationLeading = p.model.RectificationLeading;

                    var aState = p.model.aState;

                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $ApplyModifyApproval.List.length; i++) {
                        var user = $ApplyModifyApproval.List[i];
                        if (RegionName && user.RegionName.indexOf(RegionName) == -1)
                            continue;
                        if (RiskPosition && user.RiskPosition.indexOf(RiskPosition) == -1)
                            continue;
                        if (OrganizationType && user.OrganizationType.indexOf(OrganizationType) == -1)
                            continue;
                        if (InspectTime && user.InspectTime.indexOf(InspectTime) == -1)
                            continue;
                        if (InspectType && user.InspectType.indexOf(InspectType) == -1)
                            continue;
                        if (RiskType && user.RiskType.indexOf(RiskType) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (RectificationLeading && user.RectificationLeading.indexOf(RectificationLeading) == -1)
                            continue;

                        if (aState && user.aState.indexOf(aState) == -1)
                            continue;

                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;

            ////删除
            case '/api/ApplyModifyApproval/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $ApplyModifyApproval.List.length; i++) {
                    temp.push($ApplyModifyApproval.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $ApplyModifyApproval.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/ApplyModifyApproval/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($ApplyModifyApproval.List.length == 0) {
                        $ApplyModifyApproval.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var RegionName = p.model.RegionName;
                    var RiskPosition = p.model.RiskPosition;
                    var OrganizationType = p.model.OrganizationType;
                    var InspectTime = p.model.InspectTime;
                    var InspectType = p.model.InspectType;
                    var RiskType = p.model.RiskType;
                    var RiskLevel = p.model.RiskLevel;
                    var RectificationLeading = p.model.RectificationLeading;


                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $ApplyModifyApproval.List.length; i++) {
                        var user = $ApplyModifyApproval.List[i];
                        if (RegionName && user.RegionName.indexOf(RegionName) == -1)
                            continue;
                        if (RiskPosition && user.RiskPosition.indexOf(RiskPosition) == -1)
                            continue;
                        if (OrganizationType && user.OrganizationType.indexOf(OrganizationType) == -1)
                            continue;
                        if (InspectTime && user.InspectTime.indexOf(InspectTime) == -1)
                            continue;
                        if (InspectType && user.InspectType.indexOf(InspectType) == -1)
                            continue;
                        if (RiskType && user.RiskType.indexOf(RiskType) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (RectificationLeading && user.RectificationLeading.indexOf(RectificationLeading) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/ApplyModifyApproval/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$ApplyModifyApproval.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/ApplyModifyApproval/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$ApplyModifyApproval.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].InstitutionTypes = thisuser.InstitutionTypes;
                        thisUsers[i].CompanyName = thisuser.CompanyName;
                        thisUsers[i].RiskDescription = thisuser.RiskDescription;
                        thisUsers[i].RegionName = thisuser.RegionName;
                        thisUsers[i].RiskPosition = thisuser.RiskPosition;
                        thisUsers[i].OrganizationType = thisuser.OrganizationType;
                        thisUsers[i].InspectTime = thisuser.InspectTime;
                        thisUsers[i].InspectType = thisuser.InspectType;
                        thisUsers[i].RiskType = thisuser.RiskType;
                        thisUsers[i].RiskLevel = thisuser.RiskLevel;
                        thisUsers[i].RectificationLeading = thisuser.RectificationLeading;
                        thisUsers[i].AfterRImg = thisuser.AfterRImg;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$ApplyModifyApproval.List.unshift({
                        id: Mock.Random.id(),
                        InstitutionTypes: thisuser.InstitutionTypes,
                        CompanyName: thisuser.CompanyName,
                        RiskDescription: thisuser.RiskDescription,
                        RegionName: thisuser.RegionName,
                        RiskPosition: thisuser.RiskPosition,
                        OrganizationType: thisuser.OrganizationType,
                        InspectTime: thisuser.InspectTime,
                        InspectType: thisuser.InspectType,
                        RiskType: thisuser.RiskType,
                        RiskLevel: thisuser.RiskLevel,
                        RectificationLeading: thisuser.RectificationLeading,
                        AfterRImg: thisuser.AfterRImg,
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);

            var RiskRegion = randomTreeNode(myTree, '0', true);
            var RiskPosition = randomTreeNode(myTree, RiskRegion);
            var dataNum = [];//获取隐患治理编号后几位时间
            var myDate = new Date();    //获取当前年份(2位)
            var year = myDate.getFullYear();    //获取完整的年份(4位,1970-????)
            var month = myDate.getMonth();       //获取当前月份(0-11,0代表1月)
            if (month < 10) {
                month = "0" + (month * 1 + 1);
            };
            var day = myDate.getDate();        //获取当前日(1-31)
            if (day < 10) {
                day = "0" + day;
            };
            var dayNow = year + (month) + day;
            dataNum.push(dayNow)
            $ApplyModifyApproval.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                troubleNum: 'XXXX' + dataNum,//隐患治理编号

                InstitutionTypes: '上级单位',
                CompanyName: randomValue("w1012006"),//
                RiskDescription: randomValue("w1012004"),
                RegionName: RiskRegion,
                RiskPosition: RiskPosition,
                OrganizationType: randomKey("103"),
                InspectTime: Mock.Random.datetime(),
                InspectType: randomKey('101'),
                RiskType: randomKey('100'),
                RiskLevel: randomKey("03"),
                RectificationLeading: PersonInChargeIdA,
                Discoverer: Mock.Random.cname(),
                AfterRImg: [
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#67C23A', '#FFFFFF', 'Test Image1'),
                    },
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#E6A23C', '#FFFFFF', 'Test Image2'),
                    },
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#F56C6C', '#FFFFFF', 'Test Image3'),
                    }
                ],

                //隐患管理台账查询20190628
                RectificationCase: randomValue("w1012001"), //整改目标或方案                                   11111
                RectificationFund: '200万', //整改资金
                Department: '技术科', //整改责任部门
                PlanTime: Mock.Random.datetime('yyyy-MM-dd'), //计划完成时间
                CurrentPlan: randomValue("w1012002"), //当前控制措施                                         1111111111111
                HaveContingencyPlan: '否', //是否制定应急预案
                ActualTime: Mock.Random.datetime('yyyy-MM-dd HH:mm:ss'), //实际完成时间 
                RectificationDescription: randomValue("w1012005"), //整改描述                                      11111111111111
                BeforeRImg: Mock.Random.image('100x50', '#67C23A', '#FFFFFF', 'Test Image1'), //整改前照片
                // AfterRImg: Mock.Random.image('100x50', '#E6A23C', '#FFFFFF', 'Test Image2'), //整改后照片
                Rectification: Mock.Random.cname(),//验收人
                AppointPerson: Mock.Random.cname(),//验收人
                ReportPersonnel: Mock.Random.cname(),//上报人员
                RectificationLeading: Mock.Random.cname(),//整改责任人
                Acceptancer: Mock.Random.cname(),//制定验收人
                AppointTime: Mock.Random.datetime('yyyy-MM-dd'),  //验收时间
                ApprovalResult: randomValue("w1012003"), //验收意见                                     11111111
                //aState: randomValue("82"), //状态
                aState: randomKey("82"), //状态
                CheckTime: Mock.Random.datetime('yyyy-MM-dd'), //检查时间
                ReportTime: Mock.Random.datetime('yyyy-MM-dd HH:mm:ss'), //上报时间
                DevelopPlanTime: Mock.Random.datetime('yyyy-MM-dd HH:mm:ss'), //制定整改计划时间
                ReportDepartment: randomValue("111"), //上报部门


            }));

        }
    }
}

//带班长审批
var $MonitorApproval = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            //获取List数据
            case '/api/MonitorApproval/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($MonitorApproval.List.length == 0) {
                        $MonitorApproval.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var Discoverer = p.model.Discoverer;
                    var ApprovalDate = p.model.ApprovalDate;
                    var RiskType = p.model.RiskType;
                    var RiskLevel = p.model.RiskLevel;


                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $MonitorApproval.List.length; i++) {
                        var user = $MonitorApproval.List[i];
                        if (Discoverer && user.Discoverer.indexOf(Discoverer) == -1)
                            continue;
                        if (ApprovalDate && user.ApprovalDate.indexOf(ApprovalDate) == -1)
                            continue;
                        if (RiskType && user.RiskType.indexOf(RiskType) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/MonitorApproval/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$MonitorApproval.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/MonitorApproval/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$MonitorApproval.List;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].RiskLevel = thisuser.RiskLevel;
                        thisUsers[i].AppointPerson = thisuser.AppointPerson;
                        thisUsers[i].ApprovalOpinion = thisuser.ApprovalOpinion;
                        thisUsers[i].ApprovalResult = thisuser.ApprovalResult;
                        break;
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);

            var RiskRegion = randomTreeNode(myTree, '0', true);
            var RiskPosition = randomTreeNode(myTree, RiskRegion);
            var dataNum = [];//获取隐患治理编号后几位时间
            var myDate = new Date();    //获取当前年份(2位)
            var year = myDate.getFullYear();    //获取完整的年份(4位,1970-????)
            var month = myDate.getMonth();       //获取当前月份(0-11,0代表1月)
            if (month < 10) {
                month = "0" + (month * 1 + 1);
            };
            var day = myDate.getDate();        //获取当前日(1-31)
            if (day < 10) {
                day = "0" + day;
            };
            var dayNow = year + (month) + day;
            dataNum.push(dayNow)
            $MonitorApproval.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                troubleNum: 'XXXX' + dataNum,//隐患治理编号
                Discoverer: Mock.Random.cname(),
                OrganizationType: randomKey("103"),
                DiscoveryTime: Mock.Random.datetime(),
                InspectType: randomKey('101'),
                RiskRegion: RiskRegion,
                RiskPosition: RiskPosition,
                RiskType: randomKey('100'),
                RiskLevel: randomKey("03"),
                RiskDescription: randomValue("w1012004"),
                ApprovalResult: randomKey("130"),
                AppointPerson: null,
                ApprovalOpinion: '',
                BeforeRectificationImg: [
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#67C23A', '#FFFFFF', 'Test Image1'),
                    },
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#E6A23C', '#FFFFFF', 'Test Image2'),
                    },
                    {
                        id: Mock.Random.id(),
                        Img: Mock.Random.image('200x100', '#F56C6C', '#FFFFFF', 'Test Image3'),
                    }
                ],
            }));

        }
    }
}
//重大隐患档案
var $MajorRiskDossier = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            //获取List数据
            case '/api/MajorRiskDossier/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($MajorRiskDossier.List.length == 0) {
                        $MajorRiskDossier.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var Discoverer = p.model.Discoverer;
                    var DiscoveryTime = p.model.DiscoveryTime;
                    var RiskType = p.model.RiskType;
                    var RiskLevel = p.model.RiskLevel;
                    var ReportType = p.model.ReportType;
                    var RectificationLeading = p.model.RectificationLeading;


                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $MajorRiskDossier.List.length; i++) {
                        var user = $MajorRiskDossier.List[i];
                        if (Discoverer && user.Discoverer.indexOf(Discoverer) == -1)
                            continue;
                        if (DiscoveryTime && user.DiscoveryTime.indexOf(DiscoveryTime) == -1)
                            continue;
                        if (RiskType && user.RiskType.indexOf(RiskType) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (ReportType && user.ReportType.indexOf(ReportType) == -1)
                            continue;
                        if (RectificationLeading && user.RectificationLeading.indexOf(RectificationLeading) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/MajorRiskDossier/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$MajorRiskDossier.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }

                if (parent.$MajorRiskDossier.List.length == 0) {
                    parent.$MajorRiskDossier.InitArray();
                }
                myuser = parent.$MajorRiskDossier.List[0];
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/MajorRiskDossier/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$MajorRiskDossier.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].RiskName = thisuser.RiskName;
                        thisUsers[i].RiskNum = thisuser.RiskNum;
                        thisUsers[i].ReportDiscussion = thisuser.ReportDiscussion;
                        thisUsers[i].ReviewOpinions = thisuser.ReviewOpinions;
                        thisUsers[i].Solution = thisuser.Solution;
                        thisUsers[i].TimeNode = thisuser.TimeNode;
                        thisUsers[i].Leading = thisuser.Leading;
                        thisUsers[i].AcceptanceReport = thisuser.AcceptanceReport;
                        thisUsers[i].Acceptancer = thisuser.Acceptancer;
                        thisUsers[i].AcceptanceTime = thisuser.AcceptanceTime;
                        thisUsers[i].Judges = thisuser.Judges;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
                    var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
                    var RiskRegion = randomTreeNode(myTree, '0', true);
                    var RiskPosition = randomTreeNode(myTree, RiskRegion);
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$MajorRiskDossier.List.unshift({
                        //列表页数据
                        id: Mock.Random.id(),//序号
                        Discoverer: Mock.Random.cname(),
                        OrganizationType: randomKey("103"),
                        DiscoveryTime: Mock.Random.datetime(),
                        InspectType: randomKey('101'),
                        RiskRegion: RiskRegion,
                        RiskPosition: RiskPosition,
                        RiskType: randomKey('100'),
                        RiskLevel: randomKey("03"),
                        RiskDescription: randomValue("w1012004"),
                        ApprovalResult: randomKey("130"),
                        AppointPerson: null,
                        ApprovalOpinion: '',
                        ReportType: randomKey('102'),
                        RectificationLeading: PersonInChargeIdA,

                        //表单页数据初始化
                        RiskName: thisuser.RiskName,
                        RiskNum: thisuser.RiskNum,
                        ReportDiscussion: thisuser.ReportDiscussion,
                        ReviewOpinions: thisuser.ReviewOpinions,
                        Solution: thisuser.Solution,
                        TimeNode: thisuser.TimeNode,
                        Leading: thisuser.Leading,
                        AcceptanceReport: thisuser.AcceptanceReport,
                        Acceptancer: thisuser.Acceptancer,
                        AcceptanceTime: thisuser.AcceptanceTime,
                        Judges: thisuser.Judges,
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargePidB = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
            var PersonInChargeIdB = randomTreeNode(PersonInChargeTree, PersonInChargePidB);

            var RiskRegion = randomTreeNode(myTree, '0', true);
            var RiskPosition = randomTreeNode(myTree, RiskRegion);
            var dataNum = [];//获取隐患治理编号后几位时间
            var myDate = new Date();    //获取当前年份(2位)
            var year = myDate.getFullYear();    //获取完整的年份(4位,1970-????)
            var month = myDate.getMonth();       //获取当前月份(0-11,0代表1月)
            if (month < 10) {
                month = "0" + (month * 1 + 1);
            };
            var day = myDate.getDate();        //获取当前日(1-31)
            if (day < 10) {
                day = "0" + day;
            };
            var dayNow = year + (month) + day;
            dataNum.push(dayNow)
            $MajorRiskDossier.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                troubleNum: 'XXXX' + dataNum,//隐患治理编号

                Discoverer: Mock.Random.cname(),
                OrganizationType: randomKey("103"),
                DiscoveryTime: Mock.Random.datetime(),
                InspectType: randomKey('101'),
                RiskRegion: RiskRegion,
                RiskPosition: RiskPosition,
                RiskType: randomKey('100'),
                RiskLevel: randomKey("03"),
                RiskDescription: randomValue("w1012004"),
                ApprovalResult: randomKey("130"),
                AppointPerson: null,
                ApprovalOpinion: '',
                ReportType: randomKey('102'),
                RectificationLeading: PersonInChargeIdA,

                //表单页数据初始化
                RiskName: Mock.mock('@csentence(4)'),
                RiskNum: Mock.Random.id(),
                ReportDiscussion: Mock.mock('@cparagraph(1, 3)'),
                ReviewOpinions: Mock.mock('@cparagraph(1, 3)'),
                Solution: Mock.mock('@cparagraph(1, 3)'),
                TimeNode: Mock.mock('@cparagraph(1, 3)'),
                Leading: PersonInChargeIdA,
                AcceptanceReport: Mock.mock('@cparagraph(1, 3)'),
                Acceptancer: PersonInChargeIdA,
                AcceptanceTime: Mock.Random.datetime(),
                Judges: [PersonInChargeIdB],


            }));

        }
    }
}
//重大隐患档案
var $Rectification = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/Rectification/DeleteMuti': Mock.mock(host + url, type, function (options) {
                var delIDs = options.body;
                var temp = [];
                for (var i = 0; i < $Rectification.List.length; i++) {
                    temp.push($Rectification.List[i]);
                }
                for (var i = 0; i < temp.length; i++) {

                    if (delIDs.includes(temp[i].id)) {
                        $Rectification.List.splice(temp[i], 1);
                    }
                }
                return { result: "Success", message: null, data: null };
            }); break;
            //获取List数据
            case '/api/Rectification/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($Rectification.List.length == 0) {
                        $Rectification.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var Discoverer = p.model.Discoverer;
                    var DiscoveryTime = p.model.DiscoveryTime;
                    var RiskType = p.model.RiskType;
                    var RiskLevel = p.model.RiskLevel;
                    var ReportType = p.model.ReportType;
                    var RectificationLeading = p.model.RectificationLeading;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $Rectification.List.length; i++) {
                        var user = $Rectification.List[i];
                        if (Discoverer && user.Discoverer.indexOf(Discoverer) == -1)
                            continue;
                        if (DiscoveryTime && user.DiscoveryTime.indexOf(DiscoveryTime) == -1)
                            continue;
                        if (RiskType && user.RiskType.indexOf(RiskType) == -1)
                            continue;
                        if (RiskLevel && user.RiskLevel.indexOf(RiskLevel) == -1)
                            continue;
                        if (ReportType && user.ReportType.indexOf(ReportType) == -1)
                            continue;
                        if (RectificationLeading && user.SetRectificationLeading.indexOf(RectificationLeading) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/Rectification/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$Rectification.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
            ////提交
            case '/api/Rectification/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$Rectification.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].RiskDescription = thisuser.RiskDescription;
                        thisUsers[i].RectificationCase = thisuser.RectificationCase;
                        thisUsers[i].RectificationFund = thisuser.RectificationFund;
                        thisUsers[i].SetRectificationLeading = thisuser.SetRectificationLeading;
                        thisUsers[i].Department = thisuser.Department;
                        thisUsers[i].SetRectificationer = thisuser.SetRectificationer;
                        thisUsers[i].HaveContingencyPlan = thisuser.HaveContingencyPlan;
                        thisUsers[i].PlanTime = thisuser.PlanTime;
                        thisUsers[i].CurrentPlan = thisuser.CurrentPlan;
                        thisUsers[i].EmergencyPlan = thisuser.EmergencyPlan;
                        thisUsers[i].RectificationImg = thisuser.RectificationImg;
                        thisUsers[i].ActualTime = thisuser.ActualTime;
                        thisUsers[i].RectificationDescription = thisuser.RectificationDescription;
                        thisUsers[i].Acceptancer = thisuser.Acceptancer;
                        thisUsers[i].HaveContractor = thisuser.HaveContractor;
                        thisUsers[i].Contractor = thisuser.Contractor;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
                    var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
                    var RiskRegion = randomTreeNode(myTree, '0', true);
                    var RiskPosition = randomTreeNode(myTree, RiskRegion);
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$Rectification.List.unshift({
                        //列表页数据
                        id: Mock.Random.id(),//序号
                        Discoverer: PersonInChargeIdA,
                        OrganizationType: randomKey("103"),
                        DiscoveryTime: Mock.Random.datetime(),
                        InspectType: randomKey('101'),
                        RiskRegion: RiskRegion,
                        RiskPosition: RiskPosition,
                        RiskType: randomKey('100'),
                        RiskLevel: randomKey("03"),
                        RiskDescription: randomValue("w1012004"),
                        ApprovalResult: randomKey("130"),
                        AppointPerson: null,
                        ApprovalOpinion: '',
                        ReportType: randomKey('102'),

                        //表单页数据初始化
                        RiskDescription: thisuser.RiskDescription,
                        RectificationCase: thisuser.RectificationCase,
                        RectificationFund: thisuser.RectificationFund,
                        SetRectificationLeading: thisuser.SetRectificationLeading,
                        Department: thisuser.Department,
                        SetRectificationer: thisuser.SetRectificationer,
                        HaveContingencyPlan: thisuser.HaveContingencyPlan,
                        PlanTime: thisuser.PlanTime,
                        CurrentPlan: thisuser.CurrentPlan,
                        EmergencyPlan: thisuser.EmergencyPlan,
                        RectificationImg: thisuser.RectificationImg,
                        ActualTime: thisuser.ActualTime,
                        RectificationDescription: thisuser.RectificationDescription,
                        Acceptancer: thisuser.Acceptancer,
                        HaveContractor: thisuser.HaveContractor,
                        Contractor: thisuser.Contractor

                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargePidB = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
            var PersonInChargeIdX = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
            var PersonInChargeIdB = randomTreeNode(PersonInChargeTree, PersonInChargePidB);

            var RiskRegion = randomTreeNode(myTree, '0', true);
            var RiskPosition = randomTreeNode(myTree, RiskRegion);
            var dataNum = [];//获取隐患治理编号后几位时间
            var myDate = new Date();    //获取当前年份(2位)
            var year = myDate.getFullYear();    //获取完整的年份(4位,1970-????)
            var month = myDate.getMonth();       //获取当前月份(0-11,0代表1月)
            if (month < 10) {
                month = "0" + (month * 1 + 1);
            };
            var day = myDate.getDate();        //获取当前日(1-31)
            if (day < 10) {
                day = "0" + day;
            };
            var dayNow = year + (month) + day;
            dataNum.push(dayNow)
            $Rectification.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                troubleNum: 'XXXX' + dataNum,//隐患治理编号

                Discoverer: PersonInChargeIdA,
                OrganizationType: randomKey("103"),
                DiscoveryTime: Mock.Random.datetime(),
                InspectType: randomKey('101'),
                RiskRegion: RiskRegion,
                RiskPosition: RiskPosition,
                RiskType: randomKey('100'),
                RiskLevel: randomKey("03"),
                RiskDescription: randomValue("w1012004"),
                ApprovalResult: randomKey("130"),
                AppointPerson: null,
                ApprovalOpinion: '',
                ReportType: randomKey('102'),
                ReportTime: Mock.Random.datetime(),
                ReportDepartment: randomValue("111"), //上报部门
                ReportPersonnel: Mock.Random.cname(),//上报人员


                //表单页数据初始化
                RiskDescription: randomValue("w1012004"),
                RectificationCase: randomValue("w1012001"),
                RectificationFund: '200万',
                SetRectificationLeading: PersonInChargeIdX,
                Department: RiskRegion,
                SetRectificationer: PersonInChargeIdB,
                HaveContingencyPlan: '0',
                PlanTime: Mock.Random.datetime(),
                CurrentPlan: randomValue("w1012002"),
                EmergencyPlan: Mock.mock('@cparagraph(1, 3)'),
                RectificationImg: [],
                ActualTime: '',
                RectificationDescription: randomValue("w1012005"),
                Acceptancer: null,

                HaveContractor: '1',
                Contractor: '2'

            }));

        }
    }
}
//EChart
var $RiskManageEchart = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            //获取List数据
            case '/api/RiskManageEchart/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($OperationsAndActivities.List.length == 0) {
                        $OperationsAndActivities.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var JobSteps = p.model.JobSteps;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $OperationsAndActivities.List.length; i++) {
                        var user = $OperationsAndActivities.List[i];
                        if (JobSteps && user.JobSteps.indexOf(JobSteps) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/RiskManageEchart/get': Mock.mock(host + url, type, function (options) {

                var p = JSON.parse(options.body);
                var result = {};
                var legend = [];
                var data = [];
                console.log(p.model.type)
                switch (p.model.type) {
                    case "RiskCategory":
                        result = {
                            title: "隐患类别饼状图",
                            subtext: '隐患类别',
                            legend: ['A类', 'B类', 'C类', 'D类', 'E类'],
                            data: [
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'A类'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'B类'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'C类'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'D类'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'E类'
                                }
                            ]
                        };
                        break;
                    case "RiskDepartment":
                        DicCode.forEach(function (v, i) {
                            if (v.code == '14') {
                                v.data.forEach(function (vv, i) {
                                    legend.push(vv.value);
                                    data.push({
                                        value: Math.floor(Math.random() * 500),
                                        name: vv.value
                                    })
                                })
                            }
                        })
                        result = {
                            title: "隐患部门饼状图",
                            subtext: '隐患部门',
                            legend: legend,
                            data: data
                        };
                        break;
                    case "RiskFactory":
                        result = {
                            title: "隐患工厂饼状图",
                            subtext: '隐患工厂',
                            legend: ['A工厂', 'B工厂', 'C工厂', 'D工厂', 'E工厂'],
                            data: [
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'A工厂'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'B工厂'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'C工厂'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'D工厂'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'E工厂'
                                }
                            ]
                        };
                        break;
                    case "RiskLevel":
                        DicCode.forEach(function (v, i) {
                            if (v.code == '03') {
                                v.data.forEach(function (vv, i) {
                                    legend.push(vv.value);
                                    data.push({
                                        value: Math.floor(Math.random() * 500),
                                        name: vv.value
                                    })
                                })
                            }
                        })
                        result = {
                            title: "隐患级别饼状图",
                            subtext: '隐患级别',
                            legend: legend,
                            data: data
                        };
                        break;
                    case "RiskTrendLine":
                        break;
                    default:
                        break;
                }
                return {
                    result: "Success", message: null,
                    data: result
                };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $RiskManageEchart.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                JobSteps: randomKey("21"),//作业步骤
                Task: randomKey("24"),//工作任务
                CheckStandard: Mock.mock('@cparagraph(1, 3)'),//检查标准
                RiskOfViolation: Mock.mock('@cparagraph(1, 3)'),//违反标准的风险
                RiskLevel: randomKey('03'),//风险等级
                TreeNode: randomTreeNode(myTree)
            }));

        }
    }
}



// 重复隐患统计
var $RepeatRiskPieChart = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            //获取List数据
            case '/api/RepeatRiskPieChart/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($OperationsAndActivities.List.length == 0) {
                        $OperationsAndActivities.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var JobSteps = p.model.JobSteps;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $OperationsAndActivities.List.length; i++) {
                        var user = $OperationsAndActivities.List[i];
                        if (JobSteps && user.JobSteps.indexOf(JobSteps) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            ////获取Input数据
            case '/api/RepeatRiskPieChart/get': Mock.mock(host + url, type, function (options) {

                var p = JSON.parse(options.body);
                var result = {};
                var legend = [];
                var data = [];
                console.log(p.model.type)
                switch (p.model.type) {
                    case "RiskCategory":
                        result = {
                            title: "隐患级别饼状图",
                            subtext: '隐患级别',
                            legend: ['一级', '二级', '三级', '四级', '重大'],
                            data: [
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: '一级'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: '二级'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: '三级'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: '四级'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: '重大'
                                }
                            ]
                        };
                        break;
                    case "RiskDepartment":
                        DicCode.forEach(function (v, i) {
                            if (v.code == '14') {
                                v.data.forEach(function (vv, i) {
                                    legend.push(vv.value);
                                    data.push({
                                        value: Math.floor(Math.random() * 500),
                                        name: vv.value
                                    })
                                })
                            }
                        })
                        result = {
                            title: "隐患部门饼状图",
                            subtext: '隐患部门',
                            legend: legend,
                            data: data
                        };
                        break;
                    case "RiskFactory":
                        result = {
                            title: "隐患工厂饼状图",
                            subtext: '隐患工厂',
                            legend: ['A工厂', 'B工厂', 'C工厂', 'D工厂', 'E工厂'],
                            data: [
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'A工厂'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'B工厂'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'C工厂'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'D工厂'
                                },
                                {
                                    value: Math.floor(Math.random() * 500),
                                    name: 'E工厂'
                                }
                            ]
                        };
                        break;
                    case "RiskLevel":
                        DicCode.forEach(function (v, i) {
                            if (v.code == '03') {
                                v.data.forEach(function (vv, i) {
                                    legend.push(vv.value);
                                    data.push({
                                        value: Math.floor(Math.random() * 500),
                                        name: vv.value
                                    })
                                })
                            }
                        })
                        result = {
                            title: "隐患级别饼状图",
                            subtext: '隐患级别',
                            legend: legend,
                            data: data
                        };
                        break;
                    case "RiskTrendLine":
                        break;
                    default:
                        break;
                }
                return {
                    result: "Success", message: null,
                    data: result
                };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $RepeatRiskPieChart.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                JobSteps: randomKey("21"),//作业步骤
                Task: randomKey("24"),//工作任务
                CheckStandard: Mock.mock('@cparagraph(1, 3)'),//检查标准
                RiskOfViolation: Mock.mock('@cparagraph(1, 3)'),//违反标准的风险
                RiskLevel: randomKey('03'),//风险等级
                TreeNode: randomTreeNode(myTree)
            }));

        }
    }
}





//隐患排查任务查看
var $RiskTask = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            //获取List数据
            case '/api/RiskTask/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($RiskTask.List.length == 0) {
                        $RiskTask.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var PersonInCharge = p.model.PersonInCharge;
                    var ContainRegion = p.model.ContainRegion;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $RiskTask.List.length; i++) {
                        var user = $RiskTask.List[i];
                        if (PersonInCharge && user.PersonInCharge.indexOf(PersonInCharge) == -1)
                            continue;
                        if (ContainRegion && user.ContainRegion.indexOf(ContainRegion) == -1)
                            continue;
                        limitUsers2.push(user);
                    }

                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
            //提交
            case '/api/RiskTask/Save': Mock.mock(host + url, type, function (options) {
                var thisuser = JSON.parse(options.body);
                var thisUsers = parent.$RiskTask.List;
                var cz = true;
                for (var i = 0; i < thisUsers.length; i++) {
                    if (thisUsers[i].id == thisuser.id) {
                        thisUsers[i].Unit = thisuser.Unit;
                        thisUsers[i].Objective = thisuser.Objective;
                        thisUsers[i].PersonInCharge = thisuser.PersonInCharge;
                        thisUsers[i].Participant = thisuser.Participant;
                        thisUsers[i].Content = thisuser.Content;
                        thisUsers[i].Requirements = thisuser.Requirements;
                        thisUsers[i].StandardType = thisuser.StandardType;
                        thisUsers[i].InvestigationPost = thisuser.InvestigationPost;
                        thisUsers[i].Remark = thisuser.Remark;
                        thisUsers[i].TimeS = thisuser.TimeS;
                        thisUsers[i].TimeE = thisuser.TimeE;
                        thisUsers[i].UpPerson = thisuser.UpPerson;
                        thisUsers[i].InputTable = thisuser.InputTable;
                        thisUsers[i].status = thisuser.status;
                        cz = false;
                        break;
                    }
                }
                if (cz) {
                    //Input 页面需要 去操作List页面的数组 parent
                    parent.$RiskTask.List.unshift({
                        id: Mock.Random.id(),
                        Unit: thisuser.Unit,
                        Objective: thisuser.Objective,
                        PersonInCharge: thisuser.PersonInCharge,
                        Participant: thisuser.Participant,
                        Content: thisuser.Content,
                        Requirements: thisuser.Requirements,
                        Frequency: thisuser.Frequency,
                        StandardType: thisuser.StandardType,
                        InvestigationPost: thisuser.InvestigationPost,
                        Remark: thisuser.Remark,
                        TimeS: thisuser.TimeS,
                        TimeE: thisuser.TimeE,
                        UpPerson: thisuser.UpPerson,
                        status: thisuser.status,
                        InputTable: thisuser.InputTable,
                        // FrequencyText: thisuser.Frequency?$RiskContent.ShowFrequencyText(thisuser.Frequency.Type, thisuser.Frequency.MoveUp, thisuser.Frequency.Text):''
                    });
                }
                return { result: "Success", message: null, data: null };
            }); break;
            ////获取Input数据
            case '/api/RiskTask/get': Mock.mock(host + url + '?' + param, type, function (options) {

                var myUsers = parent.$RiskTask.List;
                myuser = {};
                for (var i = 0; i < myUsers.length; i++) {
                    if (myUsers[i].id == vueApp.id) {
                        myuser = myUsers[i];
                        break;
                    }
                }
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            var PersonInChargePidA = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargePidB = randomTreeNode(PersonInChargeTree, '0', true);
            var PersonInChargeIdA = randomTreeNode(PersonInChargeTree, PersonInChargePidA);
            var PersonInChargeIdB = randomTreeNode(PersonInChargeTree, PersonInChargePidB);

            var StandardList = $RiskTask.generateData();//生成排查标准数据
            var InputTable = [];
            for (var k = 0; k < 5; k++) {
                var id = Mock.Random.id()
                var Project = Mock.mock('@csentence(4)');
                var Region = randomTreeNode(myTree, '0', true);
                var Remark = Mock.mock('@csentence(6)');
                var c = 0;
                for (var j = 0; j < Math.random() * 8 + 1; j++) {
                    //随机生成排查标准内容
                    var Standard = StandardList[Math.floor(Math.random() * StandardList.length)];
                    //去重开关
                    var flag = true;
                    InputTable.forEach(function (v, i) {
                        //判断是否已有相同内容的排查标准
                        if (v.Standard.name === Standard.name) {
                            flag = false;
                        }
                    })
                    if (flag) {
                        c++;
                        //加个序号而已
                        Standard.data = c + '.' + Standard.data;
                        InputTable.push(Mock.mock({
                            id: id,
                            Project: Project,//排查项目
                            Region: Region,//涉及区域
                            Remark: Remark,//备注说明
                            //Standard: `${j + 1}.` + Mock.mock('@csentence(6)'),//排查标准
                            Standard: Standard,//排查标准
                            RiskLevel: randomKey("03"),//隐患级别
                            Result: randomKey("TaskResult"),//TaskResult
                            Source: randomValue('n108'),//来源
                            Result: randomValue('n109'),//排除结果
                            AddClass: randomValue('n104'),//排查项目

                        }));
                    }

                }

            }
            $RiskTask.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                TimeSlot: Mock.Random.datetime(),//本次排查时间段
                TimeS: Mock.Random.date(),//排查开始时间
                TimeE: Mock.Random.date(),//排查结束时间
                UpPerson: Mock.Random.cname(),//上报人
                status: randomValue("n54"),//上报人
                Frequency: '一天一次',//频次
                ContainRegion: randomTreeNode(myTree),//所含区域
                Items: Mock.mock('@cword(5)') + '项目',//所含项目
                Participant: [PersonInChargeIdB],//参与人
                PersonInCharge: PersonInChargeIdA,//负责人
                Objective: Mock.mock('@cword(5)') + '目的',//排查目的
                Unit: Mock.mock('@cword(5)') + '单位',//排查单位
                Requirements: Mock.mock('@cword(20)') + '要求',//排查要求
                Content: Mock.mock('@cword(20)') + '内容',//排查内容
                InputTable: InputTable,
            }));

        }
    },
    generateData: function () {
        const data = [];
        for (let i = 1; i <= 15; i++) {
            data.push(Mock.mock({
                name: i,
                data: '排查标准' + i,
                type: '6'
            }));
        }
        return data;
    }
}
//{
//    name: 'TaskResult',//隐患排查任务查看结果
//        code: 'TaskResult',
//            data: [
//                { key: '0', value: '正常' },
//                { key: '1', value: '异常' },
//                { key: '2', value: '未检查' },
//            ]
//},
//Echart-按承包商统计
var $ContractorStatistics = {
    DealUrl: function (vueApp, url, type, param) {

        var my = vueApp;
        switch (url) {
            //获取List数据
            case '/api/ContractorStatistics/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($ContractorStatistics.List.length == 0) {
                        $ContractorStatistics.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var ContractorName = p.model.ContractorName;
                    var TimeArray = p.model.TimeArray;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $ContractorStatistics.List.length; i++) {
                        var user = $ContractorStatistics.List[i];
                        if (ContractorName && user.ContractorName.indexOf(ContractorName) == -1)
                            continue;
                        limitUsers2.push(user);
                    }
                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $ContractorStatistics.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                ContractorName: randomKey("12"),//承包商名称
                RiskCount: Math.floor(Math.random() * 10),//隐患次数
                StatisticalTime: Mock.Random.datetime(),//统计时间
            }));

        }
    }
}
//Echart-隐患整改率统计
var $HiddenTroubleRectificationStatistics = {
    DealUrl: function (vueApp, url, type, param) {

        var my = vueApp;
        switch (url) {
            //获取List数据
            case '/api/HiddenTroubleRectificationStatistics/GetList': Mock.mock(host + url, type,
                function (options) {
                    var delIDs = options.body;
                    if ($HiddenTroubleRectificationStatistics.List.length == 0) {
                        $HiddenTroubleRectificationStatistics.InitArray();
                    }
                    var p = JSON.parse(options.body);
                    //条件
                    var ContractorName = p.model.ContractorName;
                    var TimeArray = p.model.TimeArray;
                    //分页
                    var offset = p.offset;
                    var limit = p.limit;
                    var limitUsers2 = [];
                    for (var i = 0; i < $HiddenTroubleRectificationStatistics.List.length; i++) {
                        var user = $HiddenTroubleRectificationStatistics.List[i];
                        if (ContractorName && user.ContractorName.indexOf(ContractorName) == -1)
                            continue;
                        limitUsers2.push(user);
                    }
                    var limitUsers = [];
                    for (var i = 0; i < limitUsers2.length; i++) {
                        if (i < offset + limit && i >= offset) {
                            limitUsers.push(limitUsers2[i]);
                        }
                    }
                    return {
                        result: "Success", message: null,
                        data: { pageData: limitUsers, rowCount: limitUsers2.length }
                    };
                }); break;
        }
    },
    List: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $HiddenTroubleRectificationStatistics.List.push(Mock.mock({
                id: Mock.Random.id(),//序号
                PlanRectificationTime: Mock.Random.date(),//计划整改时间
                PlanRectificationNum: 100,//计划整改数
                ActualCompletionNum: Mock.mock({
                    "number|85-100": 100
                }).number,//实际完成数
            }));

        }
    }
}

//隐患记录详细信息模拟数据  
var $RiskRecordView = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            //获取Input数据
            case '/api/RiskRecordView/get': Mock.mock(host + url, type, function (options) {
                var myuser = Mock.mock({
                    id: Mock.Random.id(),//序号
                    Discoverer: Mock.Random.cname(),
                    OrganizationType: randomKey("103"),//组织类别
                    DiscoveryTime: Mock.Random.datetime(),//隐患发现时间
                    InspectType: randomKey("101"),//检查类别
                    RiskType: randomKey("100"),//隐患分类
                    RiskLevel: randomKey('03'),//风险等级
                    ReportType: randomKey('102'),//上报类别
                    RiskDescription: randomValue("w1012004"),
                    BeforeRectificationImg: [
                        {
                            id: Mock.Random.id(),
                            Img: Mock.Random.image('200x100', '#67C23A', '#FFFFFF', 'Test Image1'),
                        },
                        {
                            id: Mock.Random.id(),
                            Img: Mock.Random.image('200x100', '#E6A23C', '#FFFFFF', 'Test Image2'),
                        },
                        {
                            id: Mock.Random.id(),
                            Img: Mock.Random.image('200x100', '#F56C6C', '#FFFFFF', 'Test Image3'),
                        }
                    ],
                });
                return {
                    result: "Success", message: null, data: myuser
                };
            }); break;
        }
    }
}
////生成treeNode随机数,如果b为true则获取父级节点，否则为最底级节点
//var pid = randomTreeNode(RisksTree, '0', true); 获取父id为0（顶级节点），数据集为RisksTree中的节点，并随机返回一条
//var cid = randomTreeNode(RisksTree, pid);获取父id为pid，数据集为RisksTree中的最底级节点，并随机返回一条
//var id  = randomTreeNode(RisksTree);获取数据集为RisksTree中的最底级节点，并随机返回一条
function randomTreeNode(tree, pid, b) {
    var result = '';
    var tempArray = [];
    if (!b) {
        var idArray = [];
        var pidArray = [];
        tree.forEach(function (v, i) {
            if (pid) {
                if (pid == v.pid) {
                    idArray.push(v.id);
                    pidArray.push(v.pid);
                }
            }
            else {
                idArray.push(v.id);
                pidArray.push(v.pid);
            }
        })
        tempArray = idArray.filter(function (v) { return pidArray.indexOf(v) === -1 });
        result = tempArray[Math.floor(Math.random() * tempArray.length)] + '';
    }
    else {
        tree.forEach(function (v, i) {
            if (v.pid + '' == '0') {
                tempArray.push(v.id);
            }
        })
        result = tempArray[Math.floor(Math.random() * tempArray.length)] + '';
    }
    return result;
}
//根据tree数据中的id获取对应的name值
function getTreeValue(tree, id) {
    var value = '';
    tree.forEach(function (v, i) {
        if (v.id + '' == id + '') {
            value = v.name;
            return;
        }
    })
    return value;
}
//树型数据扁平化处理
function fnCommon(data, pid) {
    var result = [], temp;
    data.forEach(function (v, i) {
        if (v.pid == pid) {
            var obj = {};
            for (var key in v) {
                obj[key] = v[key];
            }
            temp = this.fnCommon(data, data[i].id);
            if (temp.length > 0) {
                obj.children = temp;
            }
            result.push(obj);
        }
    })
    return result
}
//对应fnCommon的删除事件
function onDeleteForTree(mythis, url) {
    if (mythis.ListItem.tableMultipleSelection.length == 0) {

        showMessage(msg.AtLeastOne, 'error')
        return;
    }
    mythis.$confirm(' 是否确认继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
    }).then(function () {
        var delIds = [];
        for (var i = 0; i < mythis.ListItem.tableMultipleSelection.length; i++) {
            var item = mythis.ListItem.tableMultipleSelection[i];
            delIds.push(item.id);
        }
        var temp = [];
        for (var i = 0; i < mythis.mydata.length; i++) {
            temp.push(mythis.mydata[i]);
        }
        for (var i = 0; i < temp.length; i++) {
            if (delIds.includes(temp[i].id)) {
                mythis.mydata.splice(i, 1);
            }
        }
        mythis.TreeTable = fnCommon(mythis.mydata, "0");
        showMessage(msg.OperatingOk, "success");

    }).catch(function () {
        showMessage("已取消删除!");
    });

}
//车间
var myTree =
    [
        {
            "id": '110',
            "pid": '0',
            "name": "RT车间",
        },
        {
            "id": '110001',
            "pid": '110',
            "name": "公共区域",
        },
        {
            "id": '110002',
            "pid": '110',
            "name": "工作区域",
        },
        {
            "id": '111',
            "pid": '0',
            "name": "PPD车间",
        },
        {
            "id": '111001',
            "pid": '111',
            "name": "卫生区域",
        },
        {
            "id": '111002',
            "pid": '111',
            "name": "存储区域",
        },
        {
            "id": '112',
            "pid": '0',
            "name": "动力车间",
        },
        {
            "id": '110001',
            "pid": '112',
            "name": "工作区域",
        },
        {
            "id": '110002',
            "pid": '112',
            "name": "休息区域",
        },
        {
            "id": '113',
            "pid": '0',
            "name": "电仪车间",
        },
        {
            "id": '111001',
            "pid": '113',
            "name": "电表区域",
        },
        {
            "id": '111002',
            "pid": '113',
            "name": "仪器区域",
        },
    ];
//车间
var myTree2 =
    [
        {
            "id": '110',
            "pid": '0',
            "name": "操作与相关作业活动",
        },
        {
            "id": '110001',
            "pid": '110',
            "name": "A区域",
        },
        {
            "id": '110002',
            "pid": '110',
            "name": "B区域",
        },
        {
            "id": '111',
            "pid": '0',
            "name": "设备设施",
        },
        {
            "id": '111001',
            "pid": '111',
            "name": "A区域",
        },
        {
            "id": '111002',
            "pid": '111',
            "name": "B区域",
        },
        {
            "id": '112',
            "pid": '0',
            "name": "工艺介质",
        },
        {
            "id": '110001',
            "pid": '112',
            "name": "A区域",
        },
        {
            "id": '110002',
            "pid": '112',
            "name": "B区域",
        },
        {
            "id": '113',
            "pid": '0',
            "name": "场所环境",
        },
        {
            "id": '111001',
            "pid": '113',
            "name": "A区域",
        },
        {
            "id": '111002',
            "pid": '113',
            "name": "B区域",
        },
        {
            "id": '114',
            "pid": '0',
            "name": "基础管理类",
        },
        {
            "id": '111001',
            "pid": '114',
            "name": "A区域",
        },
        {
            "id": '111002',
            "pid": '114',
            "name": "B区域",
        },
    ];

//基础管理类隐患排查库
var RisksTree =
    [
        {
            "id": '300001',
            "pid": '0',
            "name": "安全基础管理隐患排查表",
        },
        {
            "id": '400001',
            "pid": '300001',
            "name": '安全管理机构的建立、安全生产责任制、安全管理制度的健全和落实'
        },
        {
            "id": '400002',
            "pid": '300001',
            "name": '企业安全生产费用的提取、使用'
        },
        {
            "id": '400003',
            "pid": '300001',
            "name": '安全培训教育管理'
        },
        {
            "id": '300002',
            "pid": '0',
            "name": "区域位置及总图布置隐患排查表",
        },
        {
            "id": '400004',
            "pid": '300002',
            "name": "区域位置",
        },
        {
            "id": '400005',
            "pid": '300002',
            "name": "总图布置",
        },
        {
            "id": '300003',
            "pid": '0',
            "name": "工艺隐患排查表",
        },
        {
            "id": '300004',
            "pid": '0',
            "name": "设备隐患排查表",
        },
        {
            "id": '300005',
            "pid": '0',
            "name": "电气系统隐患排查表",
        },
        {
            "id": '400006',
            "pid": '300003',
            "name": "工艺的安全管理",
        },
        {
            "id": '400007',
            "pid": '300004',
            "name": "设备管理制度及管理体系",
        },
        {
            "id": '400008',
            "pid": '300005',
            "name": "电气安全管理",
        }
    ];
//基础管理类隐患排查库
var BasicTree =
    [
        {
            "id": '300001',
            "pid": '0',
            "name": "",
        },
        {
            "id": '400001',
            "pid": '300001',
            "name": '1、安全基础管理隐患排查表'
        },
        {
            "id": '400002',
            "pid": '300001',
            "name": '2、区域位置及总图布置隐患排查表'
        },
        {
            "id": '400003',
            "pid": '300001',
            "name": '3、工艺隐患排查表'
        },
    ];
//隐患类型
var RiskType = [
    {
        "id": 1,
        "code": 10000,
        "pid": 0,
        "name": "生产作业活动",
        "remark": '入库前，由质量管理部组织工程设备科及动力车间查看质量合格证，检查外观无裂纹、无划痕，表面光洁，验收合格，方可入库。',
    },
    {
        "id": 2,
        "pid": 1,
        "code": 10001,
        "name": "奥罐区甲酮",
        "remark": '外力撞击导致表盘破损，指针脱落或卡滞，表盘有杂质不清晰',
    },
    {
        "id": 3,
        "pid": 1,
        "code": 10002,
        "name": "苯胺储罐设备",
        "remark": '煤气管线锈蚀或煤气含杂质导致引压管堵塞或针型阀堵塞，造成不显示。',
    },
    {
        "id": 4,
        "pid": 1,
        "code": 10003,
        "name": "动火",
        "remark": '闸板与阀杆的固定销脱落或断裂，阀杆螺母、手轮、或锁紧螺母滑丝或缺失，阀杆腐蚀。',
    },
    {
        "id": 5,
        "code": 20000,
        "pid": 0,
        "name": "维护作业活动",
        "remark": '脱硫的装置的填料过期，导致煤气中的腐蚀性气体含量过高，阀芯腐蚀。',
    },
    {
        "id": 6,
        "code": 20001,
        "pid": 5,
        "name": "管线设备打开",
        "remark": '活塞螺母未紧固，阀片破损、断裂，密封垫片老化、破损、缸盖螺母未紧固、缸套有裂纹，缸盖内壁或缸套内壁有裂纹或砂眼、填料组件水密封垫片老化、开裂，导致液击，造成缸盖破坏。',
    }
    ,
    {
        "id": 7,
        "code": 30001,
        "pid": 2,
        "name": "管线设备打开",
        "remark": '活塞螺母未紧固，阀片破损、断裂，密封垫片老化、破损、缸盖螺母未紧固、缸套有裂纹，缸盖内壁或缸套内壁有裂纹或砂眼、填料组件水密封垫片老化、开裂，导致液击，造成缸盖破坏。',
    }
];
//负责人
var PersonInChargeTree = [
    { "id": 100, "pid": 0, "name": "总经理" },
    { "id": 200, "pid": 0, "name": "生产部" },
    { "id": 300, "pid": 0, "name": "技术科" },
    { "id": 400, "pid": 0, "name": "工程设备科" },
    { "id": 100001, "pid": 100, "name": "张慧雯" },
    { "id": 100002, "pid": 100, "name": "李井仁" },
    { "id": 200001, "pid": 200, "name": "胡伟" },
    { "id": 200002, "pid": 200, "name": "王思文" },
    { "id": 300001, "pid": 300, "name": "李唐" },
    { "id": 300002, "pid": 300, "name": "康辉" },
    { "id": 400001, "pid": 400, "name": "王静婷" },
]
var Cycle = [
    "Year", "Month", "HalfYear", "Quarter", "TenDay", "Week", "Customized", "Day"
]
//var DicCode = [
//    {
//        name: 'RiskLevel',//风险级别
//        code: '03',
//        data:
//            [
//                { key: '0301', value: '一级' },
//                { key: '0302', value: '二级' },
//                { key: '0303', value: '三级' },
//                { key: '0304', value: '四级' },
//                { key: '0305', value: '特级' }
//            ]
//    },
//    {
//        name: 'JobSteps',//作业步骤
//        code: '21',
//        data:
//            [
//                { key: '0', value: '检查法兰垫片跑冒滴漏' },
//                { key: '1', value: '检查阀门跑冒滴漏' },
//                { key: '2', value: '检查静电跨接线' },
//                { key: '3', value: '检查设备设施腐蚀状态' },
//                { key: '4', value: '检查硝基苯储罐' }
//            ]
//    },
//    {
//        name: 'Device',//设备
//        code: '23',
//        data:
//            [
//                { key: '0', value: '储罐' },
//                { key: '1', value: '移动平台' },
//                { key: '2', value: '磁力泵' },
//                { key: '3', value: '阀门' },
//                { key: '4', value: '仪表' },
//                { key: '5', value: '管线' }
//            ]
//    },
//    {
//        name: 'JobTask',//作业任务
//        code: '24',
//        data:
//            [
//                { key: '0', value: '紧固螺栓' },
//                { key: '1', value: '更换垫片' },
//                { key: '2', value: '阀芯渗漏压盖螺栓紧固' },
//                { key: '3', value: '损坏更换作业' },
//                { key: '4', value: '硝基苯储罐伴热系统作业' }
//            ]
//    },


//    {
//        name: 'Factor',//要素特性
//        code: '31',
//        data:
//            [
//                { key: '0', value: '分子筛出口温度' },
//                { key: '1', value: '分子筛出口管道中CO2浓度' },
//                { key: '2', value: '分子筛出口空气杂志' }
//            ]
//    },
//    {
//        name: 'Introducer',//引导词
//        code: '32',
//        data:
//            [
//                { key: '0', value: '多' },
//                { key: '1', value: '少' }
//            ]
//    },
//    {
//        name: 'Deviation',//偏差
//        code: '33',
//        data:
//            [
//                { key: '0', value: '温度高（大于24℃）' },
//                { key: '1', value: '浓度大于1ppm' },
//                { key: '2', value: '分子筛出口空气含粉末杂质' }
//            ]
//    },
//    {
//        name: 'PlaceEnvironment',//场所环境
//        code: '34',
//        data:
//            [
//                { key: '0', value: '备料系统' },
//                { key: '1', value: '蒸汽干燥系统' }
//            ]
//    },
//    {
//        name: 'EnergySource',//能量源
//        code: '35',
//        data:
//            [
//                { key: '0', value: '电气设备' },
//                { key: '1', value: '皮带运输机' },
//                { key: '3', value: '行人' },
//                { key: '4', value: '叉车' },
//                { key: '5', value: '物料' },
//                { key: '6', value: '干燥布袋及氮气' }
//            ]
//    },
//    {
//        name: 'JobModule',//作业模块
//        code: '36',
//        data:
//            [
//                { key: '2801', value: '配料及运输' },
//                { key: '2802', value: '管道' }

//            ]
//    },
//    {
//        name: 'RepairItems',//维修项目
//        code: '37',
//        data:
//            [
//                { key: '0', value: '电动葫芦' },
//                { key: '1', value: '配料仓' },
//                { key: '2', value: '胶带运输机' }

//            ]
//    },
//    {
//        name: 'JobActivities',//作业活动
//        code: '38',
//        data:
//            [
//                { key: '0', value: '上料' },
//                { key: '1', value: '启动' },
//                { key: '2', value: '试运行' }

//            ]
//    },
//    {
//        name: 'Equipment',//设备
//        code: '39',
//        data: [
//            { key: '0', value: '离心风机' },
//            { key: '1', value: '电动葫芦' },
//            { key: '2', value: '11号移动胶带运输机' }
//        ]
//    },
//    {
//        name: 'FunctionalPart',//功能部分
//        code: '40',
//        data: [
//            { key: '4000', value: '驱动电机' },
//            { key: '4001', value: '联轴器' },
//            { key: '4002', value: '11轴承箱' },
//            { key: '4003', value: '吊钩' }
//        ]
//    },
//    {
//        name: 'Sub-functionalPart',//子功能部分
//        code: '41',
//        data: [
//            { key: '4100', value: '电机过热' },
//            { key: '4101', value: '损坏失效' },
//            { key: '4102', value: '电机短路' },
//            { key: '4103', value: '单相接地' },
//            { key: '4104', value: '无法打开' },
//            { key: '4105', value: '破损' }
//        ]
//    },
//    {
//        name: 'Parts',//部件
//        code: '42',
//        data: [
//            { key: '0', value: '驱动电机' },
//            { key: '1', value: '联轴器' },
//            { key: '2', value: '轴承箱' },
//            { key: '3', value: '吊钩' }
//        ]
//    },
//    {
//        name: 'ExpectedFunction',//预期功能
//        code: '43',
//        data: [
//            { key: '0', value: '电机过热' },
//            { key: '1', value: '损坏失效' },
//            { key: '2', value: '电机短路' },
//            { key: '2', value: '单相接地' },
//            { key: '2', value: '无法打开' },
//            { key: '2', value: '破损' }
//        ]
//    },
//    {
//        name: 'Fault',//故障
//        code: '44',
//        data: [
//            { key: '0', value: '电机过热' },
//            { key: '1', value: '损坏失效' },
//            { key: '2', value: '电机短路' },
//            { key: '2', value: '单相接地' },
//            { key: '2', value: '无法打开' },
//            { key: '2', value: '破损' }
//        ]
//    }

//]


















////隐患管理

////隐患管理-隐患排查标准知识库
//{ "parentId": "3aefb144-f677-45b3-90e2-e4d507003a00", "serialNumber": 1, "name": "隐患排查标准知识库", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003A11", "url": null, "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003a11" },
////隐患管理-隐患排查标准知识库-操作与相关作业活动
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507003a11", "serialNumber": 1, "name": "操作与相关作业活动", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003B01", "url": "RisksManagement/StandardKnowledgeBase/OperationsAndActivitiesList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003b01" },
////隐患管理-隐患排查标准知识库-检查维修作业活动
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507003a11", "serialNumber": 2, "name": "检查维修作业活动", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003B02", "url": "RisksManagement/StandardKnowledgeBase/RepairActivitiesList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003b02" },
////隐患管理-隐患排查标准知识库-设备设施
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507003a11", "serialNumber": 3, "name": "设备设施", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003B03", "url": "RisksManagement/StandardKnowledgeBase/EquipmentFacilitiesList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003b03" },
////隐患管理-隐患排查标准知识库-工艺介质
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507003a11", "serialNumber": 4, "name": "工艺介质", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003B04", "url": "RisksManagement/StandardKnowledgeBase/ProcessMediumList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003b04" },
////隐患管理-隐患排查标准知识库-场所环境
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507003a11", "serialNumber": 5, "name": "场所环境", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003B05", "url": "RisksManagement/StandardKnowledgeBase/PlaceEnvironmentList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003b05" },
////隐患管理-隐患排查标准知识库-基础管理类隐患排查库
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507003a11", "serialNumber": 6, "name": "基础管理类隐患排查库", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003B06", "url": null, "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003b06" },
////隐患管理-隐患排查标准知识库-基础管理类隐患排查库-排查内容与排查标准
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507003b06", "serialNumber": 1, "name": "排查内容与排查标准", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003C11", "url": "RisksManagement/StandardKnowledgeBase/ContentsAndStandardsList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003c11" },
////隐患管理-隐患排查标准知识库-基础管理类隐患排查库-排查项目
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507003b06", "serialNumber": 2, "name": "排查项目", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003C12", "url": "RisksManagement/StandardKnowledgeBase/InvestigationItemsList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003c12" },
////隐患管理-隐患排查标准知识库-基础管理类隐患排查库-基础管理类隐患排查库
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507003b06", "serialNumber": 3, "name": "基础管理类隐患排查库", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003C13", "url": "RisksManagement/StandardKnowledgeBase/BasicInvestigateDatabaseList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003c13" },
////隐患管理-隐患等级管理
//{ "parentId": "3aefb144-f677-45b3-90e2-e4d507003a00", "serialNumber": 2, "name": "隐患等级管理", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003A01", "url": "RisksManagement/RiskLevelList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003a01" },
////隐患管理-隐患排查类型管理
//{ "parentId": "3aefb144-f677-45b3-90e2-e4d507003a00", "serialNumber": 3, "name": "隐患排查类型管理", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003A02", "url": "RisksManagement/RiskTypeList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003a02" },
////隐患管理-隐患排查类别管理
//{ "parentId": "3aefb144-f677-45b3-90e2-e4d507003a00", "serialNumber": 4, "name": "隐患排查类别管理", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003A03", "url": "RisksManagement/RiskCategoryList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003a03" },
////隐患管理-隐患排查内容管理
//{ "parentId": "3aefb144-f677-45b3-90e2-e4d507003a00", "serialNumber": 5, "name": "隐患排查内容管理", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003A04", "url": "RisksManagement/RiskContentList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003a04" },


////隐患管理-隐患排查上报管理6
//{ "parentId": "3aefb144-f677-45b3-90e2-e4d507003a00", "serialNumber": 6, "name": "隐患排查上报管理", "code": "A74E34A4-FE2E-4856-AA3B-E4D507005C09", "url": null, "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507005c09" },
////隐患管理-隐患排查上报管理-上报管理
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507005c09", "serialNumber": 1, "name": "上报管理", "code": "A74E34A4-FE2E-4856-AA3B-E4D5070B5C01", "url": "RisksManagement/RiskReport/RiskReportList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d5070b5c01" },
////隐患管理-隐患排查上报管理-带班长审批
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507005c09", "serialNumber": 2, "name": "带班长审批", "code": "A74E34A4-FE2E-4856-AA3B-E4D5070B5C02", "url": "RisksManagement/RiskReport/MonitorApprovalList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d5070b5c02" },
////隐患管理-隐患排查上报管理-外部检查内容管理
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507005c09", "serialNumber": 3, "name": "外部检查内容管理", "code": "A74E34A4-FE2E-4856-AA3B-E4D5070B5C03", "url": "RisksManagement/RiskReport/ExternalInspectionList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d5070b5c03" },
////隐患管理-隐患排查上报管理-重大隐患信息录入
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507005c09", "serialNumber": 4, "name": "重大隐患信息录入", "code": "A74E34A4-FE2E-4856-AA3B-E4D5070B5C04", "url": "RisksManagement/MajorRisk/MajorRiskDossierList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d5070b5c04" },
////隐患管理-隐患排查上报管理-制定整改计划
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507005c09", "serialNumber": 5, "name": "制定整改计划", "code": "A74E34A4-FE2E-4856-AA3B-E4D5070B5C05", "url": "RisksManagement/RectificationPlanList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d5070b5c05" },
////隐患管理-隐患排查上报管理-整改人进行整改
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507005c09", "serialNumber": 6, "name": "整改人进行整改", "code": "A74E34A4-FE2E-4856-AA3B-E4D5070B5C06", "url": "RisksManagement/RectificationList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d5070b5c06" },

////隐患管理-隐患排查治理管理7
//{ "parentId": "3aefb144-f677-45b3-90e2-e4d507003a00", "serialNumber": 7, "name": "隐患排查治理管理", "code": "A74E34A4-FE2E-4856-AA3B-E4D507004B01", "url": null, "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507004b01" },
////隐患管理-隐患排查治理管理-隐患验收
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507004b01", "serialNumber": 1, "name": "隐患验收", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003A05", "url": "RisksManagement/RiskGovern/RiskAcceptanceList.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003a05" },

////隐患管理-隐患统计8
//{ "parentId": "3aefb144-f677-45b3-90e2-e4d507003a00", "serialNumber": 8, "name": "隐患统计", "code": "A74E34A4-FE2E-4856-AA3B-E4D507008998", "url": null, "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507008998" },
////隐患管理-隐患统计-隐患趋势折线图统计
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507008998", "serialNumber": 1, "name": "隐患趋势折线图统计", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003999", "url": "RisksManagement/Echarts/RiskTrendLineChart.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003999" },
////隐患管理-隐患统计-隐患趋势折线图统计
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507008998", "serialNumber": 2, "name": "隐患类别饼状图统计", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003998", "url": "RisksManagement/Echarts/RiskCategoryPieChart.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003998" },
////隐患管理-隐患统计-隐患趋势折线图统计
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507008998", "serialNumber": 3, "name": "隐患级别饼状图统计", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003997", "url": "RisksManagement/Echarts/RiskLevelPieChart.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003997" },
////隐患管理-隐患统计-隐患趋势折线图统计
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507008998", "serialNumber": 4, "name": "隐患工厂饼状图统计", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003996", "url": "RisksManagement/Echarts/RiskFactoryPieChart.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003996" },
////隐患管理-隐患统计-隐患趋势折线图统计
//{ "parentId": "a74e34a4-fe2e-4856-aa3b-e4d507008998", "serialNumber": 5, "name": "隐患部门饼状图统计", "code": "A74E34A4-FE2E-4856-AA3B-E4D507003995", "url": "RisksManagement/Echarts/RiskDepartmentPieChart.html", "type": 0, "icon": "fa fa-link", "remarks": null, "id": "a74e34a4-fe2e-4856-aa3b-e4d507003995" },
